Date issues (1 Viewer)

POLARBILLY

New member
Local time
Today, 16:16
Joined
Oct 28, 2011
Messages
3
Using a linked table which is an Excel download from a bookings app we use. As the “Time and Date” column was causing issues I created another field using the “Left” command and formatted it “Date”. Whilst my query accepts the date format, when I use” DatePart("w",[date])” and WeekdayName the result is a day out. E.g. it says the 5 Apr is weekday 4 – a Thursday, but it is actually a Wednesday. I then changed [date] to [date]-1 – result!. Sadly, it didn’t like the 0(Sunday) it returned and came up with “#Func!”.

All help appreciated

Yours Aye

Bill
 

Gasman

Enthusiastic Amateur
Local time
Today, 16:16
Joined
Sep 21, 2011
Messages
14,311
No, weekdayname does not return an integer, weekday does, and the default is Sunday as first day of the week, so 4 is correct for Wed
Look up the syntax for both functions, as weekdayname has same option.:(
 
Last edited:

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:16
Joined
Feb 19, 2002
Messages
43,295
Have you changed the starting day of the week to Monday?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:16
Joined
May 7, 2009
Messages
19,245
it says the 5 Apr is weekday 4 – a Thursday
what is your Regional Date setting, d/m/yyyy?
it seems your calculated "Date" column has converted it into:

5/4/2023 or 05/04/2023

access uses (US-english date) format, so it interpret your "Date" column as:

May 4, 2023 (Thursday), and not April 5, 2023 (Wednesday).
 

Users who are viewing this thread

Top Bottom