Alternative to Date() for web database?

nickbarnes

New member
Local time
Today, 19:32
Joined
Aug 23, 2011
Messages
9
Hello again!

I need to use the Date() function in a few queries and forms with criteria such as:

Between (Date()-1) And (Date()+14)
<=Date()
<Date()

The database will eventually live on a SharePoint site which means that the Date() function cant be used as Access keeps telling me its not a web-compatible expression :(

Is there a way around this at all?

Thanks in advance!

Nick
 
Hi Nick,

The problem you are facing is not Date() in the web queries, it is Between. You cannot use Between for expressions in web objects.

So instead of using this:
Between (Date()-1) And (Date()+14)

Just use this:
>=(Date()-1) And <=(Date()+14)

Works just fine in client, it is web compatible, and will run in the browser too.

--------------------
Jeff Conrad - Access Junkie - MVP Alumnus
SDET II - Access Test Team - Microsoft Corporation

Author - Microsoft Access 2010 Inside Out
Co-author - Microsoft Office Access 2007 Inside Out
Access 2007/2010 Info: http://www.AccessJunkie.com

----------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.mspx
----------
 
Thanks a lot!

That got it working. The reason I thought Date() wasnt working was because it wasnt showing up in IntelliSense and kept giving an error whenever I typed it in.

Turns out Id stupidly put a calculated field in my table rather than the query and when I tried to set the Date criteria on the calculated field it all went wrong.

Got there eventually, thanks for your help!
 
You're welcome, glad to help.
I'm glad you have it working now. Good luck with your project and thanks for trying out the new web database functionality in Access 2010.

--------------------
Jeff Conrad - Access Junkie - MVP Alumnus
SDET II - Access Test Team - Microsoft Corporation

Author - Microsoft Access 2010 Inside Out
Co-author - Microsoft Office Access 2007 Inside Out
Access 2007/2010 Info: http://www.AccessJunkie.com

----------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.mspx
----------
 

Users who are viewing this thread

Back
Top Bottom