Jump to content

Search Help


lmhart

Recommended Posts

I have a database that stores record_date varchar(10) in the form of 2009/11/03. 

 

However I can not get it to return any data.

 

Also I am running the query in mysqladmin.

 

Will someone please advise what I am doing wrong.

 

Here is my query.

Select * from 'record' where record_date = 2009/11/03

Link to comment
https://forums.phpfreaks.com/topic/180148-search-help/
Share on other sites

In general you should NOT store dates in VARCHAR(). There's DATE datatype for that. Doing so will also allow you for easy comapring dates, adding, substracting etc, while in VARCHAR it will be much more difficult and less effiicient.

 

In particular:

Select * from 'record' where record_date = '2009/11/03'

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/180148-search-help/#findComment-950343
Share on other sites

Thanks. that works.

 

I agree with you but I can not figure out how to store a date with out using a varchar.  My info is being input after the fact and some can take up to two weeks to post.  I want it to reflect the date it occured not the date entered. So a time date stamp did not work.

Link to comment
https://forums.phpfreaks.com/topic/180148-search-help/#findComment-950356
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.