Adding Dates

Gootz11

Registered User.
Local time
Today, 23:03
Joined
Apr 5, 2002
Messages
47
Hello,
I'm building a query that will tell me the last day i can ship an item before its to old. the simple formula were using in excell is (#of days + Todays Date + 2). how can i build a query that will ask me for todays date every time i run it. in other words i want to enter "todays date" every time i run the query.

Please Help
thanks in Advance

Gootz
 
Yeah, i tried all those and it didnt work, i keep getting an error meassage i might be putting the brackets in the wrong places
MinShipDate:([min #]+[date()]+2) what's the proper way to write that expression??? where i will always get to type in the date????

Thanks Again
 
DateDiff("d",[MinShipDate],Date()) will give the number of days between your date and todays date.
DateAdd("d",[Min#],[MinShipDate]) will give the proposed shipped date, not sure where the two is coming from
 
suggest that you have a form with a text box where you input the date that you want to work off. Call the text box txtDate and the Form DateToday and then in the query you would have:

NewDate: [Forms]![DateToday]![txtDate] + 2 + [Number of Days field]

HTH
 
Thanks a lot guys!
Rich, you pointed me in the direction i wanted to go,
I ended up running two different queries to get the result:
the first query assigns the date i want to see in the expression Date:[todays date], and then i ran a seperate query with the actual calculation, MinShipDate: DateAdd("d",[Min #],[Date])

thanks to everyone that responded

Gootz
 
Date is a reserved word in Access, you shouldn't use it as a field name, also you don't need the extra query or the field
MinShipDate: DateAdd("d",[Min #],Date()) will give the same answer
 

Users who are viewing this thread

Back
Top Bottom