I feel like I have posted a million of these things. But Im learning I guess that what counts, anyway.
Here is my problem. The last line of my query. I am trying to insert a variable, that comes from a form, which I have done a million times but now I need the correct syntax for putting it with a date.
sqlString = "SELECT Count(distinct Date) as total"
sqlString = sqlString & " From ProjectNotes"
sqlString = sqlString & " WHERE Date >= _
'" & dte & "''/1/02' And Date <= " & dte & "''/31/02'"
With this all I get is an error incorrect syntax. I have tried different ways also
No ':
'" & dte & "'/1/02 And Date <= " & dte & "'/27/02"
Produces this error:
Unclosed quotation mark before the character string '/27/02'
' around the whole date:
''" & dte & "'/1/02' And Date <= '" & dte & "'/31/02'"
Produces this error:
Incorrect syntax near '4'.
Which is the number being passed in.
Thanks in advance for any help or nudges in the right direction.![[lightsaber] [lightsaber] [lightsaber]](/data/assets/smilies/lightsaber.gif)
Here is my problem. The last line of my query. I am trying to insert a variable, that comes from a form, which I have done a million times but now I need the correct syntax for putting it with a date.
sqlString = "SELECT Count(distinct Date) as total"
sqlString = sqlString & " From ProjectNotes"
sqlString = sqlString & " WHERE Date >= _
'" & dte & "''/1/02' And Date <= " & dte & "''/31/02'"
With this all I get is an error incorrect syntax. I have tried different ways also
No ':
'" & dte & "'/1/02 And Date <= " & dte & "'/27/02"
Produces this error:
Unclosed quotation mark before the character string '/27/02'
' around the whole date:
''" & dte & "'/1/02' And Date <= '" & dte & "'/31/02'"
Produces this error:
Incorrect syntax near '4'.
Which is the number being passed in.
Thanks in advance for any help or nudges in the right direction.
![[lightsaber] [lightsaber] [lightsaber]](/data/assets/smilies/lightsaber.gif)