View Single Post
  #2  
Old May 28th, 2010, 08:52 AM posted to microsoft.public.access.reports
Wolfgang Kais[_4_]
external usenet poster
 
Posts: 18
Default Use combo to print report between two sets of dates

Hello Nicole

Nicole "MoonBlosm" wrote:
[snip]
If Not IsNull(me.cboDates)Then
strWhere = strWhere & "([Date] Is Between " & Format(FromDate,
conDateFormat) _
& " And " & Format(ToDate, conDateFormat) & ") AND "
strWhere = strWhere & "([Date] Is Between " & Format(FromOTDate,
conDateFormat) _
& " And " & Format(ToOTDate, conDateFormat) & ")"
End If

[snip]
I keep getting the '3075' error, Syntax error (missing operator)
in query expression

'[DataEntry] = "Heather") AND ([Date] is Between #03/02/2010# And
#03/09/2010#) AND ([Date]) is Between #02/18/2010# And #02/24/2010))'

I am sure I am missing something quite simple, but once you have
looked at it for a few hours everything begins to blur


The "between" operator has no "is", so try this:
If Not IsNull(me.cboDates) Then
strWhere = strWhere & "([Date] Between " & Format(FromDate, conDateFormat)
_
& " And " & Format(ToDate, conDateFormat) & ") AND "
strWhere = strWhere & "([Date] Between " & Format(FromOTDate,
conDateFormat) _
& " And " & Format(ToOTDate, conDateFormat) & ")"
End If

--
Regards,
Wolfgang