Split date in day, month and year inside query

gstylianou

Registered User.
Local time
Today, 04:20
Joined
Dec 16, 2013
Messages
359
I need a query so to split the date 18/01/2023 to day=18 , month=01 and year=2023 within query. Can anyone help?
 
Yes. Use the functions that have those exact names? :(
The table name is Dates, the date as above field is the [Month_Date] which is date format (short date)

How can i split it?
 
as in post #2:

copy/paste to query designer (SQL view):

Select Day([Month_Date]) As D, Month([Month_Date]) As M, Year([Month_Date]) As Y From Dates
 
Thank you very much, working fine. Another one question,

I'm trying to make time table with time slots every 15min Starting from 00:00 Ends On 23:45. If there is a way to do it using vba?
 
i create TimeT table and from that table created TimeSlotQ query.
 

Attachments

Create a lookup table with the time slots in it.
1679577399479.png
1679577438049.png


Having the slots in a table will make you life much easier.
You can probabaly create in excel using autofill and paste them in.
 
Is there is a way to take the day name using sql query? Lets say today is 23/03/2023 to take Thursday?
 
Is there is a way to take the day name using sql query? Lets say today is 23/03/2023 to take Thursday?
I have Google on this phone.

Found via
 

Users who are viewing this thread

Back
Top Bottom