User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 361,873 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,391 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 2944 | Replies: 2
Reply
Join Date: Mar 2007
Location: Islamabad, Pakistan
Posts: 19
Reputation: Masood Ali is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
Masood Ali's Avatar
Masood Ali Masood Ali is offline Offline
Newbie Poster

How to match Todays date in sql

  #1  
Mar 20th, 2007
Hi All
I want to check whether there is a record present in my database with value:
StartDate="Todays's Date"
where start date is the column name with datatype DATE.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2006
Posts: 1,318
Reputation: masijade is a jewel in the rough masijade is a jewel in the rough masijade is a jewel in the rough 
Rep Power: 7
Solved Threads: 110
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Virtuoso

Re: How to match Todays date in sql

  #2  
Mar 20th, 2007
Use PreparedStatement and new Date (using java.sql.Date not java.util.Date).

If you question is how to formulate a query in general, then please find an SQL forum.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Join Date: Jul 2006
Location: Dublin,California
Posts: 2
Reputation: meduri99 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
meduri99's Avatar
meduri99 meduri99 is offline Offline
Newbie Poster

Re: How to match Todays date in sql

  #3  
Mar 23rd, 2007
If you have a query to fire , then use the SYSDATE as the standard one.
For example, on Oracle if I query as follows,

"select SYSDATE from DUAL", it should get me today's date. You may need to use this as part of your query. I understand you are in the midst of a Java program
So, after your query is built at Java area, you need to use the word "SYSDATE" which Oracle understands. I think it can work on other Databases too. But you may check it once.
Hope this helped.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Java Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 6:46 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC