is this a friday?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need an update query with an If statement on it. Basically, it would say
something like If AssignDate is Friday, then update Time Elapsed to 1 hour.
My problem is that the AssignDate varies and it's in a mm/dd/yyyy format. Is
there something that can identify when a date is a friday? Thanks for your
help
 
The expression
WeekDay([AssignDate],1) = 6
will return True if the date is Friday

You can use that in the criteria of the UPDATE query.

In the query grid
Field: WeekDay([AssignDate],1)
Criteria: =6

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Thank you. I'm guessing that 7 is saturday and 1 is sunday. Right? I need
to do the same with those days.

John Spencer said:
The expression
WeekDay([AssignDate],1) = 6
will return True if the date is Friday

You can use that in the criteria of the UPDATE query.

In the query grid
Field: WeekDay([AssignDate],1)
Criteria: =6

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

ty said:
I need an update query with an If statement on it. Basically, it would say
something like If AssignDate is Friday, then update Time Elapsed to 1
hour.
My problem is that the AssignDate varies and it's in a mm/dd/yyyy format.
Is
there something that can identify when a date is a friday? Thanks for
your
help
 
Correct, but you could have simply tested it to confirm.

?Weekday(Known Sunday Date) would return 1, etc.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

ty said:
Thank you. I'm guessing that 7 is saturday and 1 is sunday. Right? I
need
to do the same with those days.

John Spencer said:
The expression
WeekDay([AssignDate],1) = 6
will return True if the date is Friday

You can use that in the criteria of the UPDATE query.

In the query grid
Field: WeekDay([AssignDate],1)
Criteria: =6

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

ty said:
I need an update query with an If statement on it. Basically, it would
say
something like If AssignDate is Friday, then update Time Elapsed to 1
hour.
My problem is that the AssignDate varies and it's in a mm/dd/yyyy
format.
Is
there something that can identify when a date is a friday? Thanks for
your
help
 
Back
Top