how to get monday of this week?

B

Bre-x

hi,
i have a table that contains events.

i need to query this weeks events
and i need the to sort them by Monday, Tuesday,.... Sunday

Any ideas?

Thanks,

Bre-x
 
F

Fredg

Bre-x said:
hi,
i have a table that contains events.

i need to query this weeks events
and i need the to sort them by Monday, Tuesday,.... Sunday

Any ideas?

Thanks,

Bre-x
Bre,
Use the WeekDay() function.

Add a new column to the query:
Sorting:WeekDay([DateField])
Sort on this new column.

This will return the day of the week number, Sunday being 1, Saturday 7.

However, you indicated above that you wish Sunday to be sorted last, so
use:
Sorting:WeekDay([DateField],2)
And Monday will be sorted as the First day of the week, Sunday the Last.
 
B

Bre-x

thanks fredg
now how do it get it to display event of this week only
no last week, no next week

thnks



Fredg said:
Bre-x said:
hi,
i have a table that contains events.

i need to query this weeks events
and i need the to sort them by Monday, Tuesday,.... Sunday

Any ideas?

Thanks,

Bre-x
Bre,
Use the WeekDay() function.

Add a new column to the query:
Sorting:WeekDay([DateField])
Sort on this new column.

This will return the day of the week number, Sunday being 1, Saturday 7.

However, you indicated above that you wish Sunday to be sorted last, so
use:
Sorting:WeekDay([DateField],2)
And Monday will be sorted as the First day of the week, Sunday the Last.
 
B

Bre-x

Format([MyDate],"ww") = Format(Now(),"ww")
thnks

Fredg said:
Bre-x said:
hi,
i have a table that contains events.

i need to query this weeks events
and i need the to sort them by Monday, Tuesday,.... Sunday

Any ideas?

Thanks,

Bre-x
Bre,
Use the WeekDay() function.

Add a new column to the query:
Sorting:WeekDay([DateField])
Sort on this new column.

This will return the day of the week number, Sunday being 1, Saturday 7.

However, you indicated above that you wish Sunday to be sorted last, so
use:
Sorting:WeekDay([DateField],2)
And Monday will be sorted as the First day of the week, Sunday the Last.
 
J

John Vinson

thanks fredg
now how do it get it to display event of this week only
no last week, no next week

You can use a criterion of

BETWEEN DateAdd("d", 1 - Weekday(Date()), Date()) AND DateAdd("d", 8 -
Weekday(Date()), Date())
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top