If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Todays date minus 6 days before (Shows all records in 6 days)
Im trying to write a query that says todays date (=Date()) minus 6 days. But
i want the query to show me everything from today and the 6 days before. I have one column to add this into. Can anyone help? Thanks |
#2
|
|||
|
|||
Todays date minus 6 days before (Shows all records in 6 days)
hi,
Rach wrote: Im trying to write a query that says todays date (=Date()) minus 6 days. But i want the query to show me everything from today and the 6 days before. I have one column to add this into. Just use it as criteria in your query: SELECT * FROM [yourTable] WHERE [yourDatefield] = Date() - 6 mfG -- stefan -- |
#3
|
|||
|
|||
Todays date minus 6 days before (Shows all records in 6 days)
Rach I'd recommend the following: SELECT * From [yourTable] WHERE [yourDateField] BETWEEN DateAdd("d", -6, date()) AND Date() Keep in mind, if your Date field has time values in it that the above will not actually return any values for todays date. If that is the case, replace [yourDateField] with DateValue([yourDateField]). HTH Dale -- Email address is not valid. Please reply to newsgroup only. "Rach" wrote: Im trying to write a query that says todays date (=Date()) minus 6 days. But i want the query to show me everything from today and the 6 days before. I have one column to add this into. Can anyone help? Thanks |
Thread Tools | |
Display Modes | |
|
|