Results 1 to 3 of 3
  1. #1
    Ed
    Ed is offline Senior Member
    Join Date
    Jun 2007
    Posts
    110
    Rep Power
    0

    Default 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:
    Java 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.

  2. #2
    Peter is offline Senior Member
    Join Date
    Jun 2007
    Posts
    119
    Rep Power
    0

    Default

    WHERE dateInit = "& dteDate &"
    You have to put a simple Quotation mark (‘)and finish the concatenation of the var with the query

  3. #3
    bbq
    bbq is offline Senior Member
    Join Date
    Jun 2007
    Posts
    132
    Rep Power
    0

    Default

    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&"#"

Similar Threads

  1. Difference between current date and anothe date
    By vijay balusamy in forum New To Java
    Replies: 1
    Last Post: 04-16-2008, 05:15 PM
  2. FInal field cannot be assigned
    By ravian in forum New To Java
    Replies: 3
    Last Post: 12-13-2007, 03:26 PM
  3. Help with define an integer field
    By trill in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 08:32 AM
  4. problem with date class
    By gabriel in forum New To Java
    Replies: 3
    Last Post: 08-03-2007, 02:28 PM
  5. Replies: 2
    Last Post: 07-02-2007, 05:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •