-
query criteria = Now()
Dear all
I have a table having a date field. Now I designed a form based on a query and that query has designed through above said table. I gave =Now() in date field criteria in query.
Now I required that as the form open it matches the date field contents with current or system date and show all records fulfil the criteria. but I got null record.
Any one have an idea? if yes then please help me to figure out that problem.
Thanks.
Wasim
-
Wasim, I do not think that you need the "=" in the Criteria Row.
The other problem that you may be having is that Now() has the time as well as the date.
Try using the Date() function instead.
-
Dear OBP
I have tried Now() without '=' but didn't get eresult. Also Date function is not working. Would be you kindly explain the syntax of Date()?
Thanks.
Wasim
-
Hi,
Are you sure..the date being compared to NOW() is actually a date..? Is it Date/Time data type in the table structures...also please paste the sql query..so we can see it..
asingh
-
Hi
yes the datatype of table field is date/time and fixed to as 'short date'.
the query is as under
[vba]
SELECT Main_Mail.TicklerDate, Main_Mail.Tickler_Remarks, Main_Mail.Sub
FROM Main_Mail
WHERE (((Main_Mail.TicklerDate)=Now()));
[/vba]
Thanks for an early reply.
Wasim
Last edited by wasim_sono; 09-13-2007 at 11:33 PM.
-
Wasim
You aren't using either Date or Now in that query.
You are asking for a parameter.
-
SELECT Main_Mail.TicklerDate, Main_Mail.Tickler_Remarks, Main_Mail.Sub
FROM Main_Mail
WHERE ((Main_Mail.TicklerDate)=Date());
-
Hi
The code is now corrected.
Thanks.
Wasim
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules