how can i query for selecting timestamp? example my timestamp field is :
20050309145502
how can i search for the specific date only if my query is the exact date traditionally my syntax is :
select * from timein where timestamp = 20050309145502;
i have to select the first 8 digits only... can anyone help me....
thanks!
query for timestamp
Moderator: General Moderators
query for timestamp
thanks feyd, im sorry for these stupid questions...
i tried this one but it doesnt display the record, i really dont know the term its called, but i have d idea in my mind....
i just want to query all records having the date only... the timestamps include the time, so when i query the results are zero...
select * from tbl where timestamp = 'date_format(20050309)';
thanks so much!
i tried this one but it doesnt display the record, i really dont know the term its called, but i have d idea in my mind....
i just want to query all records having the date only... the timestamps include the time, so when i query the results are zero...
select * from tbl where timestamp = 'date_format(20050309)';
thanks so much!
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
you'll need date_format() on the timestamp, not the input date you are trying against (provided you supply in a form that is compatible with the date_format() output... You may want to research how date_format() works.. http://dev.mysql.com/doc/mysql/en/date- ... tions.html