Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is the query to look for latest date?

Status
Not open for further replies.

choohean

Technical User
Jan 15, 2002
57
MY
I try to write a query to insert the data by the conditionis the latest date but can't work...

Can someone give me a hand?

the code that I've write is like :

SQL ="UPDATE tracking SET c_name='"&c_name&"', c_email='"&c_email&"' WHERE equip_id='"&equip_id&"' AND date_in= max(date_in) "
 
You could try this.

UPDATE tracking SET c_name='"&c_name&"', c_email='"&c_email&"' WHERE equip_id='"&equip_id&"'
AND date_in =
(SELECT max(date_in) from tracking where equip_id = '"&equip_id&"')

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top