null indication in number field

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default null indication in number field

    would like to indicate when field was not writen to OR if a null value was
    posted in a number field. is there any way to write 'null' or other marker to a
    field set up to record a single number. can't use 0 as throws off 'SELECT
    avg()' when doing query as n/a entries must be ignored in stats. used in
    multiple choice where 'not applicable' is '' visitor can return to page so
    needs to post to display selections already made. client does not want a
    default choice preselected. tnx in advance.

    ranger Guest

  2. Similar Questions and Discussions

    1. NULL To DateTime field through sp
      How can I insert null value into a datetime field through stored procedure? i use cybase,cf 4
    2. hidden field 'is null or not an object'
      I've created a WYSIWYG HTML editor. I have an ImageButton whose onClick event is supposed to set the value of a hidden form field called txtHTML to...
    3. Set a datetime field to Null
      Hi I created a record set at client side and added a coulmn as date time DBRS = CreateObject("ADODB.RecordSet") DBRS.Fields.Append...
    4. Problem with null field. Plz help!
      Hi all. Could someone please help me diagnose what might be wrong with this code snippet (taken from within a program) that cropped up after I...
    5. Returns a NULL field ?
      Hi. I'm stuck! I am querying two tables in a DB using the following string SQLQuery = "SELECT GuestBook.*, GuestPic.PicName FROM GuestBook...
  3. #2

    Default Re: null indication in number field

    for ms sql server
    for statistics
    avg works only with numeric values, by default null values are ingnored.
    select avg(salary) from foobar where salary IS NOT NULL is same than select
    avg(salary) from foobar

    posting preselections
    you could change null values to some number like 666666 and trap them in your
    app.

    with text fields you can replace null values with following code:
    select ISNULL(salary_text,not applicable') as salary

    you can change datatype with CAST and CONVERT functions.

    check book on line or google to learn more.
    kim



    kim il sung Guest

  4. #3

    Default Re: null indication in number field

    is there any way in SELECT to ignore 0 in AVG tag as in AVG(s1) AS a1 s1 has
    to be numeric (can't do in WHERE statement as using a loop in SELECT statement
    SELECT <cfloop index=catz from=1 to=96 step=1> AVG(s#catz#) AS a#catz#,
    </cfloop> )

    ranger Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139