Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2003

    Unanswered: SELECT Statement Help

    Can someone please put me out of my misery?

    I have a dataase containing the following fields

    Year, Month, Day, Hour, data

    and I need to write a query that will only get records in a certain date-time range (Between startHour and endHour, both of type Date). I am struggling to come up with a SELECT statement that will do this.

    I'm working in VB under Excel accessing a ACCESS db using ADODB.

    I'm thinking along the lines of

    strSQL = "SELECT Year & ""/"" & Month & ""/"" & Day & "" "" & Hour -1 & "":00"" AS StartHour, Data FROM table WHERE ?????????????"

    Please help

  2. #2
    Join Date
    Jun 2003
    Provided Answers: 1
    In Access you can use the DateSerial function to convert your data to a microsoft date value. I'd recomment that you create and store a query that does this for you and then connect to the query from Microsoft Excel.

  3. #3
    Join Date
    Jul 2003

    Arrow SQL query

    I am sure I would be able to help with the date formatting, but could you please be a little more elaborate.

    I understand u have a table with 5 fields (YYYY, MM, DD, HH, MI).

    Now you want to get all the records between certain hour times of the day. Is that true.

    Or it is like you want to concatenate the dates ??

    It needs more elaborate explaination.
    Thanx and Regards

Posting Permissions

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