My Assistant
|
|
Apr 1 2012, 07:11 PM
Post
#1
|
|
|
UtterAccess Veteran Posts: 408 From: Tennessee |
I have a form based on this query:
CODE SELECT qryReservationsMC.*, IIf([AddedToOutlook]=True,"*","|") AS Status FROM qryReservationsMC WHERE (((qryReservationsMC.EndDate)>=Format([Forms]![frmCalendar]![txtDate],"Short Date")) AND ((qryReservationsMC.StartDate)<=Format([Forms]![frmCalendar]![txtDate],"Short Date"))); It gives me an error "the expression is typed incorrectly or is too complicated..." I think I need "#" for the dates. Any help? |
|
|
|
![]() |
Apr 1 2012, 07:26 PM
Post
#2
|
|
|
UtterAccess VIP Posts: 17,644 From: Don Mills, ON (Canada) |
Don't use the Format function: that actually converts the value to text, which is part of your problem. Instead, declare the parameter as Date:
CODE PARAMETERS [Forms]![frmCalendar]![txtDate] DateTime; SELECT qryReservationsMC.*, IIf([AddedToOutlook]=True,"*","|") AS Status FROM qryReservationsMC WHERE qryReservationsMC.EndDate)>=[Forms]![frmCalendar]![txtDate] AND qryReservationsMC.StartDate)<=[Forms]![frmCalendar]![txtDate]; (Yes, that's a semi-colon between DateTime and SELECT!) |
|
|
|
Apr 1 2012, 08:02 PM
Post
#3
|
|
|
UtterAccess Veteran Posts: 408 From: Tennessee |
Wow! Thank you so much Doug! That took care of the problem.
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 25th May 2013 - 03:38 PM |