Hi All
When I run below query I get Type mismatch in expression error. Both columns in date type
Select * from T1 where
T1.DateAsAt = (SELECT MAX(T2.DateAsAt) FROM T2)
Please clarify
Cheers
shabar
Hi All
When I run below query I get Type mismatch in expression error. Both columns in date type
Select * from T1 where
T1.DateAsAt = (SELECT MAX(T2.DateAsAt) FROM T2)
Please clarify
Cheers
shabar
Can't see anything wrong with that SQL. I tested that syntax and it works for me.
Are T1 and T2 tables or queries?
If you want to provide db for analysis, follow instructions at bottom of my post.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Select * from T1 where
T1.DateAsAt = (SELECT MAX(T2.DateAsAt) FROM T2)
for me you need to add T1 after from on the sub query to work..
Select * from T1 where
T1.DateAsAt = (SELECT MAX(T2.DateAsAt) FROM T1 as T2)
this worked for me
Select *, (SELECT MAX(T2.DateAsAt) FROM T1 as T2) as Maxdate from T1
use this if you want the max date and all the values in your Table as well.
just playing around with the query..
SELECT * FROM T1 WHERE T1.DateAsAt = (SELECT Max(DateAsAt) FROM T2);
This assumes there are two objects (tables or queries) named T1 and T2.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Thax All
I had a issue with two fields
Appreciate your response
Cheers
Shabar