Current position:  Home > Default > Comparing date with time stamp

Comparing date with time stamp

Time:October 11
Advertisement
Hii,
I am trying to write a query where i have to pick all the record which have same date even thought the time stamp is different.
'2008-06-23 14:19:23.060941'
'2008-06-23 14:30:03.647688'
I have to pick records based on the 2008-06-23.
i tried
select * from table_name where date1 = to_Date('06-23-2008', 'MM-DD-YYYY')
but it does not out put any records
plz help
Advertisement
There are a few ways to tackle this issue. One way is to truncate the dates involved to get rid of the time portion:
trunc(date1) = to_date('06-23-2008', 'MM-DD-YYYY')This method works but if there is an index on the date1 column, using the trunc function prevents your queries from being able to use the index (unless its a function based index on trunc(date1) ).
An alternative method that won't run into the index issue is to use a range test:
to_date('06-23-2008', 'MM-DD-YYYY') <= date1 AND
date1 < to_date('06-23-2008', 'MM-DD-YYYY') + 1Notice that the second condition is just the less than operator, and not the <= operator as used in the first condition since you don't want any records returned that are actually on the following day.

Function module for comparing dates and times

-0001-11-30

Hi, I have a date and time stamp in one filed for example as below: 20070125183045 (the first 8 are date in YYYYMMDD format, the next 6 is time in HHMMSS format). Now I want to compare this value to another such value in terms of date and time. First

Compare date with time

-0001-11-30

Hi , Oracle 10.2.0.1.0 I need to compare date field with time stamp as well . I tried doing byt getting time stamp using to_char and on convertion into date by using to_date , I'm loosing time stamp please help804282 wrote: I need to compare date fie

Compare data in R/3 with data in a BW Cube after the daily delta loads

2015-10-11

Hi Friends, How can I compare data in R/3 with data in a BW Cube after the daily delta loads? Are there any standard procedures for checking them or matching the number of records?Hi Sunil, If you want to check the records daily instead of checking t

Comparing data b/w biw and oltp

2015-10-11

hi Could some one can halp me how to compare data between biw and oltp system.which has been extracted. Thank for your precious time spent to help me in learning. Thanks, JagadeeshJagadish, It is not always all extracted data are coming from one stan

Comparing data in different resultsets

2015-10-11

Hi everybody! I am working on an web application involving some EAI, as a requirement i need to compare data from two different sources (databases to be precise) and fill a XML based on certain rules. I wish to know if there is a way to compare two R

How to get the most current file based on date and time stamp using SSIS?

2015-10-11

Hello, Let us assume that files get copied in a specific directory. We need to pick up a file and load data. Can you guys let me know how to get the most current file based on date and time stamp using SSIS? Thanks thx regards dinesh vvhi simon i exc

Table_comparison - how to compare data at a high level

2015-10-11

Hi, I have to do data validation at a high level between two tables that I am loading. I am trying to use table_comparion transform but the problem is that my target table is at a much lower level than at which I want to compare data. So it has many

Compare data from a table

2015-10-11

Hello, I am trying to compare data from one and the same table. In short I have:      NAME     DTM     CHARGE      Atanas     8/18/2012 9:33:23 AM     100 Atanas     8/18/2012 9:33:23 AM     101      Niki     8/18/2012 9:33:43 AM     200      Niki   

How do you edit out the date and time stamp from a photo

2015-10-11

How do you edit out the date and time stamp from a photoYou can blur it out with retouch The built-in "Retouch" brush in "Edit" mode should suffice, if the background is mostly uniform, and if you set the size of the brush to slightly

Can you remove a date and time stamp off a photo that has already been taken?

2015-10-11

Can you remove a date and time stamp off a photo that has already been taken?only with Photoshop or similar software that offer some clone/heal feature. Weekend Travelers Blog | Eastern Sierra Fall Color GuideRead other 2 answers

How do you date and time stamp pictures and videos using a EOS Rebel T3?

2015-10-11

I am needing to utilize date and time stamping on videos and photos in my work.  The pictures and videos must display time, a date, and reference number.  I have gone through the cd, owner's manuel and software manuel and I am unclear if I can perfor

How do you date and time stamp iCal entries?  We share an event calendar and need to know when a new event was entered into iCal.

2015-10-11

How do you date and time stamp iCal entries?  We share an event calendar and need to know when a new event was entered into iCal.BKBK, Thank you for your response. That does adequately cover the client-originated sessions, but still leaves the abilit

Comparing data from two tables

2015-10-11

My PL/SQL is very limited, however, I need to write some code that compares data stored in two different Oracle tables and then writes the differences to a third table. Both tables have primary keys that I will use to ensure I am comparing like for l

How to compare date which is greatest date

2015-10-11

iam new to sql how to compare date which date is greatest date with example can i use to_char to compare date SELECT eno, ename, GREATEST (TBLE.MAX1, TBLE.MAX2) recent_date "                FROM (SELECT TBLA.eno, TBLA.ename, "                MAX

How to compare date and time together

2015-10-11

Hi, How to compare Date and Time together? For example in a database table there are two fields rundate and runtime.  I want to compare these two with perticular date and time in the program.  Like, I want to pull all the records where the records's

How to compare date with char

2015-10-11

hi i am having date from and date to feilds in my overtime element.i want to do the validation on these dates the the dates do not overlap or duplicated.the input value date from and date to are stored in database as varchar2 in the format yyyy/mm/dd

Help adding current Date and Time stamp to file name

2015-10-11

I need help with my script adding current Date and Time stamp to file name. This is my file name = myfile.htm I would like to save it as = myfile.htm 8/29/2007 11:41 AM This is my script: <script> function doSaveAs(){      if (document.execCommand){

DATE and TIME Stamps

2015-10-11

I'm a relative newbie still having issues with getting date and time stamps on my printed documents. I use Preview, Pages, Numbers and also tend to print to PDF a lot, which I am opening in Preview. I have found an "Insert" ability in Pages but

How to provide date and time stamp to the extracted file.

2015-10-11

I 'm downloading data from DB to Flat file using GUI_DOWLOAD. whenever it is executed it is creating with a file name. if i rerun the program the file is overwriting with the same name. now based on the requirement how many times i executed, that man