Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-12-2007, 03:30 PM
Ed Ed is offline
Senior Member
 
Join Date: Jun 2007
Posts: 110
Ed is on a distinguished road
problem with date field
I want to filter a record in a table of SQLServer2000, the dateInit field is the primary key, but It doesn't work the CONVERT function because the record doesn't filter it, that is to say: the record doesn't find it.
I do the where like this:
Code:
Date dteDate dteDate = this.Date1.Value WHERE dateInit = "& dteDate &"
Do you know what is happening?

Last edited by Ed : 06-12-2007 at 05:28 PM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-12-2007, 05:01 PM
Senior Member
 
Join Date: Jun 2007
Posts: 119
Peter is on a distinguished road
Quote:
WHERE dateInit = "& dteDate &"
You have to put a simple Quotation mark (‘)and finish the concatenation of the var with the query
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 06-12-2007, 05:27 PM
bbq bbq is offline
Senior Member
 
Join Date: Jun 2007
Posts: 134
bbq is on a distinguished road
Don't assign to a variable, it's better if you put the content of the control literal (this.Date1.Value) between #

WHERE dateInit = #"& dteDate&"#"
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between current date and anothe date vijay balusamy New To Java 1 04-16-2008 05:15 PM
FInal field cannot be assigned ravian New To Java 3 12-13-2007 03:26 PM
Help with define an integer field trill New To Java 1 08-07-2007 08:32 AM
problem with date class gabriel New To Java 3 08-03-2007 02:28 PM
Doubt with hibernate and date field Ed Database 2 07-02-2007 05:25 PM


All times are GMT +3. The time now is 06:59 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org