Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Query Help

Status
Not open for further replies.

Jovix

Programmer
Dec 3, 2003
39
US
Hello everyone, I have a column called DueDate in a query that contains dates. I want to populate a second column based on this DueDate but, if the date in DueDate is less than today, then set the DueDate to today. Make sense? Can someone share the line of code I need to enter into my new column.

Thanks in advance, G
 
Sounds like you need a conditional if statement (psuedo-code):

=IIf(DueDate < Today, Today, DueDate)

< M!ke >
 
In a new column in your query enter the following:

NewDueDate: IIf([DueDate]<Now(),Format(Now(),&quot;mm/dd/yyyy&quot;),[DueDate])

Hope this helps you.
 
Sorry I wasn't too clear.

Enter this in the field area of a new column.

NewDueDate: IIf([DueDate]<Now(),Format(Now(),&quot;mm/dd/yyyy&quot;),[DueDate])

hth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top