i dont know how the data is inserting into this xx table(trans_date column,date datatype) but dates are in the format "dd/mm/yyyy hh:mm:ss" , when i gave the query like
i am getting the data from 1st to 4th only from the xx table.
but according to my book knowledge i should get the 5th date data also for my query. in the book some examples also there. but my doubt is how i am missing 5th date data for my query in xx table
Agador Paloi
Ranch Hand
Joined: Jan 24, 2006
Posts: 116
posted
0
Seems ok to me.
built a table xxtest :
then selected with test date between
Agad
deo swaroop
Greenhorn
Joined: May 21, 2008
Posts: 28
posted
0
I am using oracle 10G and here :
select * from txn
where txn_dt between
'30-MAY-2010' and '01-JUN-2010'
returns txns only for 30th and 31st May, it is not displaying for 1st June. why?
Also,
Is there any way to do a date search with timestamp. Like, get me all the transaction between 8AM to 10AM on 1st June2010.
we are finding it problematic, as we are using hibernate. the table column for the txn_dt is of data dype DATE.
Any suggestion ?
Thanks in advance,
Deo Swaroop
raj esh
Greenhorn
Joined: Apr 03, 2010
Posts: 10
posted
0
while inserting into the table, given systemdate
now write the query with the dates (sysdate and sysdate+5 ) then find the result
and insert two dates directly and give the query and find the result?
now find the difference.
deo swaroop
Greenhorn
Joined: May 21, 2008
Posts: 28
posted
0
Not satisfied with your asnswer.....
Is there any way to do a date search with timestamp. Like, get me all the transaction between 8AM to 10AM on 1st June2010.
we are finding it problematic, as we are using hibernate. the table column for the txn_dt is of data dype DATE.
Any suggestion ?
Agador Paloi
Ranch Hand
Joined: Jan 24, 2006
Posts: 116
posted
0
created xxtest table with this data :
selected between May 30 and June 01 as follows
seems to work ok to me.
Remember the trunc disregards the time for the date .
To select for a time frame:
I think when you use between without a time it implicitly uses 00:00 as the time.