0

I feel like I have done adequate research and come up empty handed so I now pass it off to you. Pretty simple, really: I am getting a type mismatch error in the immediate window with the following line:

?Dlookup("LastUpdated","tblBranchLocations","LocationID = 1")

The table is linked table to an Azure DB.
The field is this DateTime Extended field which seems to be a source of many problems. I can switch "LastUpdated" to a different field like "Address1" and it works fine. But when I switch to a datetime extended field, I am getting the error.
I also tried it with similar fields in a different table to identify the problem as the datetime extended fields.

I'm stumped as to why Dlookup would return a type mismatch when it returns a variant. Advise please, and thanks!

  • 1
    Review https://www.access-programmers.co.uk/forums/threads/dealing-with-date-time-extended-in-query.327239/#:~:text=Using%20the%20Date%2FTime%20Extended%20field%20type%20give%20many,with%20DTE%20field%20in%20it%3A%20DLookup%20%28%22DateTimeExtField%22%2C%20%22YourQuery%22%29 – June7 Jun 30 '23 at 18:57
  • In Access a date is just a 32bit number. Can you select it, as a number, like this in Azure: Dlookup("CLng([LastUpdated])","[tblBranchLocations]","LocationID=1") possibly it can be converted back to a date immediately like this: CDate(Dlookup("CLng([LastUpdated])","[tblBranchLocations]","LocationID=1")) – hennep Jul 04 '23 at 09:09
  • Correction, Access stores the Date/Time data type as a double-precision, floating-point number up to 15 decimal places. The integer part of the double-precision number represents the date. The decimal portion represents the time. So we need CDbl instead of CLng – hennep Jul 04 '23 at 09:30
  • No dice here. It says its too complex which makes sense when I look at it - it cant lookup the function. I see what you tried to do here and I have played with it a bit with no luck. I will keep trying and advise if i find something. Thank you for your effort, though. – TileHittinMofo Jul 06 '23 at 13:58

0 Answers0