December 18, 2013 at 3:48 am
What is the best way to filter out records which has a orderdate column in bigint format ?
December 18, 2013 at 4:05 am
Can u give some more information? Perhaps add some samples to clarify your question?
I assume you have a table with a column with datatype BIGINT. You use that column to store date-values, like the sample below.
ID...BigINT_Date
1.....20131210
2.....20131211
3.....20131212
4.....20131213
To filter the data is specific to the notation used to store the date value. If it is stored in yyyymmdd format (like my sample) you could just filter using the < and > comparison. If it is stored in a mmddyyyy format it will be more complicated. You first need to convert the value to a datetime datatype and then use the < and > comparison.
But my assumption about your situation could be completely wrong, so please give us more information!!
December 18, 2013 at 4:32 am
Thanks a lot for the quick reply.
My datetime is stored in UTC format.
Eg. 1299781800000 ( GMT: Thu, 10 Mar 2011 18:30:00 GMT, Your time zone: 11/3/2011 00:00:00 GMT+5.5)
December 18, 2013 at 11:36 am
SQL Kidu (12/18/2013)
What is the best way to filter out records which has a orderdate column in bigint format ?
The [font="Arial Black"]BEST [/font]way to do this is to attack the root cause of the problem. Dates should never be stored as BIGINT. You would do well to fix the table and the code that uses it. That would prevent the current problem and all future problems with this column.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 18, 2013 at 11:31 pm
Yeah. Make sense. This one is creating lot of confusion.. Will see to it.
Thanks BTW 🙂
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply