This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes problem with selecting data between two dates in sqlserver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "problem with selecting data between two dates in sqlserver" Watch "problem with selecting data between two dates in sqlserver" New topic
Author

problem with selecting data between two dates in sqlserver

Pankaj Chaudhary
Greenhorn

Joined: Jun 05, 2006
Posts: 16
Hi,
i want to execute a date between select query using preparedStatement in sqlserver 2000.
my date is in string format,and before setting in preparedstatement i am converting it by Date.valueOf(string) as Date in DataBase is in smallDateTime Format.
but it is not working and i am also not getting any other way to select data from table between two dates.
please help me out.
thanks in advance.
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3700
    
    5

It's probably because you have the format of the date wrong. Try looking up the Date Formatter API to guidelines on how to convert a string date into a date object.


My Blog: Down Home Country Coding with Scott Selikoff
Pankaj Chaudhary
Greenhorn

Joined: Jun 05, 2006
Posts: 16
ya i know the problem you hv told but i dont know how to solve this problem.
plz give solution me in some details.
 
Consider Paul's rocket mass heater.
 
subject: problem with selecting data between two dates in sqlserver
 
Similar Threads
Problem with Date Object
Difference between two Dates
problem in date comparing with db2 database,query is not executing
Date difference
db2 year 2000 invalid date