Please forgive me for interrupting you all on a Sunday night.
This is an easy question but my brain is no longer functioning.
Using an Access select query. In a date field I need to specify that only data of the current week must show (Monday to Friday). How do I do this - I am going mad trying to figure it out. As I say I know it is simple - just cannot think anymore. Will search the other forums in case there is no one here who can help.
A slightly harder question - how do I use the between [date] and [date] function in a crosstab query?
Thanks for any suggestions you can make.
Urgent: Date function help required for Access query
Have a look at the datepart function:
WHERE datepart(wk,your_date_field_name) = datepart(wk,now()) -- makes records match current week number
AND datepart (dw, your_date_field_name) > 1 -- monday to
AND datepart (dw, your_date_field_name) <7 -- friday
Sorry, I have no idea if it will work.
WHERE datepart(wk,your_date_field_name) = datepart(wk,now()) -- makes records match current week number
AND datepart (dw, your_date_field_name) > 1 -- monday to
AND datepart (dw, your_date_field_name) <7 -- friday
Sorry, I have no idea if it will work.
DFI LanParty X48 LT-2TR
Intel Q9450 @ 3.2Ghz
Dell 24" 2408WFP | Phillips 37" 1080p
Sapphire HD4870 X2 2GB
4GB Corsair DDR-2 1066 | Thermalrite 120 Ultra Extreme | G9 Mouse | G15 Keyboard
Vista Ultimate x64
Intel Q9450 @ 3.2Ghz
Dell 24" 2408WFP | Phillips 37" 1080p
Sapphire HD4870 X2 2GB
4GB Corsair DDR-2 1066 | Thermalrite 120 Ultra Extreme | G9 Mouse | G15 Keyboard
Vista Ultimate x64
- Tribble
- Registered User
- Posts: 88465
- Joined: 08 Feb 2007, 02:00
- Processor: Intel Core i7-4770K CPU@3.50GHz
- Motherboard: ACPI x64-based PC
- Graphics card: GeForce GTX 780 Ti
- Memory: 16GB
- Location: Not here
- Contact:
Solution (thanks to my friend Albert)
Create a column in the query with this as the field data
And this as the criteria
Thanks Hek Rated - never got to try your solution. Will do sometime and will let you know.
Create a column in the query with this as the field data
Code: Select all
Week: Format([CaptureDate],"ww")
Code: Select all
Format(Date(),"ww")
Thanks Hek Rated - never got to try your solution. Will do sometime and will let you know.