: Re: how to select last date by current time?
To: Louie Miranda [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Louie,
Do you want just the most recent date? You could run :
SELECT MAX(dateposted)
FROM datafiles
WHERE office='AC/PA'
OR if you want just the most recent record:
SELECT dateposted
List,
How can i issue a query that can select last dateposted (FIELD)?
My table:
- dateposted, format: -MM-DD
This is my current sql query which catches in desc order for
dateposted and list only 10 sql data.
select
dateposted,
filename,
description
from datafiles
where office = 'AC/PA'
This is my current sql query which catches in desc order for
dateposted and list only 10 sql data.
select
dateposted,
filename,
description
from datafiles
where office = 'AC/PA'
order by
dateposted desc limit 10;
This will probably work fine. Anyway, make sure that dateposted has
DATE field
Louie,
Do you want just the most recent date? You could run :
SELECT MAX(dateposted)
FROM datafiles
WHERE office='AC/PA'
OR if you want just the most recent record:
SELECT dateposted, filename
FROM datafiles
WHERE office='AC/PA'
ORDER BY dateposted desc
LIMIT 1;
OR you could also ask for