• New set of eyes (A2K)

    Author
    Topic
    #448708

    Your syntax error seems to indicate, by the ##, that it is not reading the [Admit_Date] field properly. Have you tried substituting something less esoteric than that particular date formatting to see if that is what is causing the problem? I haven’t seen formatting for a date using both and /. Why don’t you try plain old dashes and see what Access thinks?

    Just some thoughts. HTH

    Viewing 0 reply threads
    Author
    Replies
    • #1098126

      Edited by HansV to break enormously long line that caused horizontal scrolling
      I have this field in a query:

      PrevSTD: CDate(Nz(DMax("Discharge_Date","tIP_DEMOS_DX","Discharge_Date<#" & 
      Format([ADMIT_Date],"mm/dd/yyyy") & "# AND SSN=" & Chr(34) & [SSN] & 
      Chr(34)),#1/1/1900#))

      with a parameter of:

      >=[Discharge_Date]-30

      but continue to get an error of:

      Syntax error in date in query expression 'Discharge Date <## AND SSN="a ssn here".

      When I hit “OK” it returns:

      Unknown 

      What on earth am I missing?

      • #1098134

        Apparently ADMIT_Date can be null (empty). Perhaps you should restrict the query to records for which ADMIT_Date is not null, otherwise you must use another Nz function to replace nulls in ADMIT_Date with a valid date.

        • #1098833

          Thanks Hans, it was the NULL factor that was creating the problem. I included the Nz in the syntax and all was well.

          I resolved this a week ago but I forgot I posted this question. Sorry for the delay in response.

    Viewing 0 reply threads
    Reply To: New set of eyes (A2K)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: