Welcome! Log In Create A New Profile

Advanced

Building a query with editor needing Today()

Posted by Joel 
Joel
Building a query with editor needing Today()
March 16, 2009 10:52PM
Hi -

Trying to build a query with the query editor. I want to put in "Less than or equal to Today()" but the field will only accept a date. Do I have to do this with a parameter? I rather not have to pass the parameter each time - it's always going to be "Today". Is this not possible?

Thanks!
DerekT
Re: Building a query with editor needing Today()
March 17, 2009 12:59AM
Joel

Check out using WL functions in the 'Calculated Item' section of the Query generator.
I have not tried this sort of thing from there myself!

Failing that then edit the sql code direct (you will lose the graphical query display).
I added the last line of the Select statement and the WHERE clause (in Blue).
Something like the code below should do the trick.
I have not tested this but I do have similar code working.

SELECT 
	MemberMain.idMemberMain AS idMemberMain,	
	MemberMain.MembershipNo AS MembershipNo,	
	MemberMain.DateJoined AS DateJoined,
	WL.DateSys() AS Today
FROM 
	MemberMain
WHERE 
	MemberMain.DateJoined <= Today

HTH
Regards

DerekT
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: