how to get monday of this week?

  • Thread starter Thread starter Bre-x
  • Start date Start date
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
 
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.
 
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.
 
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.
 
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())
 
Back
Top