This content has been marked as final. Show 6 replies
Why are you still creating new dates?
And a day and a month is not a date. There is not enough information present. You need a year.
If you don't want to have years than don't use dates.
even if I gave the year information, it still does not work. maybe there is some other way to get it right. plz help
even if I gave the year information, it still doesMeaning what? Please post your current code and what problem you're having.
When you post code, please use[code] and [/code] tags as described in Formatting tips on the message entry page. It makes it much easier to read.
plz helpPlease take the time to write out words such as "please."
java.text.SimpleFormat sdf = new java.text.SimpleDateFormat("yyyy-MM-dd");
java.sql.Date dt = new java.sql.Date(sdf.parse(strDate).getTime());
as cotton advised I user the "yyyy" too, and it worked,i.e I can use the dates properly fron the Jtextfield. But, now when I am comparing the 'dt' with dates stored in my MSAccess, it returns null.
My dates in the table are stored like MM/dd/yyyy.
But, now when I am comparing the 'dt' with dates stored in my MSAccess, it returns null.How do you do your comparison?
Please post some relevant code between [code] [/code] tags.
this is the satement I use to find the dates in my table
PreparedStatement st1 = conCRT.prepareStatement(" SELECT * FROM trace WHERE DateEnt = ?, ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY); st1.setDate(1,dt); ResultSet rs1 = st1.executeQuery();