• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

sql date

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to get the day, month and year from combo boxes and making an update in my database after this date. I tried something like this:

can is the combo box for year, czi for day and cluna for month.
It doesn't work like this, I receive an error. I think it should be something else instead of (String).
 
author & internet detective
Posts: 42173
937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Aneresia White:
I receive an error.


What was the error? Sharing this information will make you more likely to get a useful reply.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,Iam Jaya.The problem you mentioned is not the reason why the code is failing.Type casting is possible.They are convertible types.There may be some other reason for the failure.Please give more details.
 
Aneresia White
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So this is the error:

but the syntax is ok I already verify it in sql. if I put (Date) instead of (String) I don't get any errors but the update is not working when I look in the database.
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need a space between 'where' and 'datav' - and replace the last 'where' with an 'and'.

Normally you will have saved the date as a DATE or TIMESTAMP field in the database, and in Java you will pass the argument to the Statement as a java.sql.Date
[ December 31, 2008: Message edited by: Rene Larsen ]
 
Aneresia White
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You were right about the space between those 2 ) How could I missed that. That's funny. But the last where it's ok, it's what I need it. Thank you.
 
A "dutch baby" is not a baby. But this tiny ad is baby sized:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic