Strange NULL return

Results 1 to 3 of 3

Thread: Strange NULL return

  1. #1
    Dave W Guest

    Default Strange NULL return

    &nbsp;<BR>Im having a little trouble with this part of an SQL string :<BR><BR>sSQL = sSQL & " (Access &#060;&#062; &#039;MyValue&#039; OR isNull(Access)) AND"<BR><BR>This works for me in Access, but generates this message in SQL7 :<BR><BR>Error Type:<BR>Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)<BR>[Microsoft][ODBC SQL Server Driver][SQL Server]The isnull function requires 2 arguments.<BR><BR>What are the 2 arguments required?<BR><BR>The reason the sql string above is used (and why its strange) is that I would have thought just "Access &#060;&#062; &#039;MyValue&#039;" would have worked, but not all records get returned.<BR><BR>eg : 10 records. 1 record with value &#039;MyValue&#039; . All others blank.<BR><BR>The SQL would return 7 records when I expect 9!!<BR><BR>Cure? or whatsup? :)<BR><BR>TIA<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Strange NULL return

    &nbsp;<BR><BR>in sql server<BR>isNull<BR><BR>takes 2 arguments<BR>first the var you are checking,<BR>and second the value you wish to replace it with,<BR>it has to be of the same type as var you are checking.<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Strange NULL return

    use:<BR>(Acces Is NULL)<BR>instead of<BR>(IsNull(Access))

Posting Permissions

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