Results 1 to 2 of 2

Thread: .NET problem with selectstatement for oledbdataadapter

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2004
    Posts
    43

    .NET problem with selectstatement for oledbdataadapter

    Hi guys,

    I have an application where I need to import an excell sheet in a dataset.

    One column (Datum) in the excell sheet contains dates in the following format : d/mm/yyyy
    But these are assumed to be strings I suppose?

    I want to import only the rows where the date is greater than a value (=DateValue) selected by the user. The problem is the datevalue comes from a datetimepicker in a VB.NET application so the type is Date

    I use the following SQL statement (as the selectcommand of my oledbdataadapter):
    "SELECT * FROM [blad1$A3:F9000] WHERE Datum >= " & DateValue

    This doesn't work and i think it has something to do with types (string vs date).

    Can anybody help me?

    thanks

    PS: [blad1$A3:F9000] is the range to select from on the excell sheet. This works fine

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    when selecting on the basis of dates, you need to enclose the date value with #

Posting Permissions

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



Click Here to Expand Forum to Full Width