Computing.Net > Forums > Unix > using select query for current date

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

using select query for current date

Reply to Message Icon

Name: kalyanbrata.dhar
Date: December 31, 2008 at 00:41:34 Pacific
OS: SunOS5.9
CPU/Ram: .
Product: . / .
Subcategory: General
Comment:

Hi,

I trying to use select query to get particular records for current date . This is my query:

select so_module,
max (to_char(SO_JOB_STARTED,'HH24:MI')) AS SO_JOB_STARTED
from so_job_history
where so_module in (
'job1',
'job2',
'job3'
)
and SO_JOB_STARTED= sysdate
group by (so_module);

for this query I am getting no errors but the output is also wrong as I am getting 'no rows selected'.

Could anyone help me in using sysdate appropriately.

kalyan



Sponsored Link
Ads by Google

Response Number 1
Name: mosaic
Date: January 4, 2009 at 21:01:35 Pacific
Reply:

sysdate is current time, it keeps changing for every second.

I think you want find records with this condition:
to_char(SO_JOB_STARTED,'YYYY-MM-DD')=to_char(sysdate,'YYYY-MM-DD')


0

Response Number 2
Name: kalyanbrata.dhar
Date: January 5, 2009 at 19:36:57 Pacific
Reply:

Thank you so much it worked.

kalyan


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: using select query for current date

How to get current date -1 hr www.computing.net/answers/unix/how-to-get-current-date-1-hr/4462.html

Korn Shell script for julian date? www.computing.net/answers/unix/korn-shell-script-for-julian-date/3729.html

subtracting days from current date www.computing.net/answers/unix/subtracting-days-from-current-date/6333.html