Date Formula

G

Guest

I have the following formula in a query:

Between NZ([Forms]![ReportForm]![txt1st],#10/11/2004#) And
NZ([Forms]![ReportForm]![txt2nd],Date())

Instead of having #10/11/2004# as default date, I would like it to simply
search for the earliest date entered in that field and start from it.
Basically, I need the opposite of the Date() funciton, I need the earliest
date to automatically calculate if nothing is put into the text field.
Everything will be included this way. Does anyone know the formula command?
 
A

Allen Browne

Unless you have dates more than 105 years ago, you could use:
Nz([Forms]![ReportForm]![txt1st], #1/1/1900#)
 
G

Guest

Try using the Dmin

Between NZ([Forms]![ReportForm]![txt1st],DMin("[DateField]","[TableName]"))
And NZ([Forms]![ReportForm]![txt2nd],Date())

But I would enter a fix date, as you did, that I know that you can't have
any earlier date then that, so the query will be faster.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top