In an empty column in the query builder, put WhatDay:
Weekday([MyDateField])
(replace MyDateField with whatever the name of your date field actuall is,
but leave the WhatDay: unchanged)
In the criteria row under that, put the weekday in which you're interested
(number between 1 and 7)
Alternatively, you could use WhatDay: Format([MyDateField], "ddd") and use
Sun, Mon, Tue, ..., Sat for the criteria, or WhatDay:
Format([MyDateField],
"dddd") and use Sunday, Monday, Tuesday, ..., Saturday. However these
aren't
considered as good an idea, since you can run into problems if the user is
using a different language.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
nigel bate said:
Douglas,
I have never try'd this type of query before. Can I pick you brains, and
ask for the Computed code for the query please.
Thank you
Nigel
Douglas J. Steele said:
Your query should have a computed field in it that indicates the
weekday
(use the Weekday function: it should return 1 for Sunday, 2 for Monday and
so on to 7 for Saturday). You can then use that computed field in your
WHERE clause.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Douglas,
Further, I need the day so that I can pull all records, say for a
Monday between 2 dates. This could mean 4 for a month or12 for a 3
monthly period, thus analysing records on given days of a week.
Strange I
know but this is what has been requested.
Thank You
Nigel
What do you get with what you're using?
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
What I need is a way of have the day of a short date put into
another
textbox. At the moment when I copy the date to the text box the
dd/mm//yy comes with it, which I don't want, as when I click the field
th date is diplayed when dddd is used. I need to use the day as a
search field instead of using dates. I have try'd the following to
no
avail.
Dim MyDate, MyDay
MyDate = Me![txtDay] Assign a date.
Me![MyDay] = Day(MyDate)
Please help
Thanks in advance
Nigel