Dlookup with Date format

AndrewKent

Well-known Member
Joined
Jul 26, 2006
Messages
889
Hi there,

Just noticed that a Dlookup I am using on a field with dates is not working correctly. The two date fields that I have are formatted "dd/mm/yyyy" however when I use the following Dlookup:

Code:
PERIOD: DLookUp("[DateMatrix_Period]","[tblMatrix_DateMatrix]","[DateMatrix_Date]=#" & [IntL_DateofLeaving] & "#")

I can see that the date formatting is getting a bit muddled (so for example 31/09/2011 remains as such but 10/09/2011 is being changed to 09/10/2011 which is mm/dd/yyyy)

How do I update this query to keep the date format as dd/mm/yyyy?

Kind reagrds,

Andy
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
You need to use U.S. date formatting for querying (you can display the way you want but the criteria must be in a non-ambiguous format).

Try this instead:

PERIOD: DLookUp("[DateMatrix_Period]","tblMatrix_DateMatrix","[DateMatrix_Date]=" & Format([IntL_DateofLeaving], \#mm\/dd\/yyyy\#"))
 
Upvote 0

Forum statistics

Threads
1,224,513
Messages
6,179,212
Members
452,895
Latest member
BILLING GUY

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top