Results 1 to 9 of 9

Thread: Select Query

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2001
    Location
    India
    Posts
    41

    Select Query

    Hi,
    I am fetching a Recordset from Oracle database. The Query is following:
    Select to_date(date1,'dd-mon-yyyy'),count(*) from Mytable
    group by to_date(date1,'dd-mon-yyyy')

    This query can be executed perfectly on Oracle prompt but in VB it produces the following error:
    multiple step generated errors. Check each status Value.

    Can anyone help me? Why this is so?
    Plz reply soon.

  2. #2

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2001
    Location
    India
    Posts
    41
    it is still not working .
    Plz reply soon.

  4. #4
    Addicted Member djengiz's Avatar
    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    153
    I need a little more information. Do you need one or more fields. etc

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2001
    Location
    India
    Posts
    41
    I want only 2 fields, the date part like '20-DEC-2001' And count of the records for that date. Ok
    Now analyze again.

  6. #6
    Addicted Member djengiz's Avatar
    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    153
    here is your aswer and dont be so rude in future pall.

    SELECT Format(date,"yyyy-mm-dd") as [Date], Count(date) AS CountOfDate
    FROM Table
    GROUP BY date;

  7. #7

    Thread Starter
    Member
    Join Date
    Jun 2001
    Location
    India
    Posts
    41
    My dear,
    Sorry if I hurt your feelings. But as I have tried many combination of this query, I could not execute this query. And again as you wrote:
    this query can't be executed on Oracle Prompt. Plz try on Oracle. I have already mentioned that I have to execute this query on Oracle prompt.
    So plz help me if you can.

    Jitendra

  8. #8
    Lively Member
    Join Date
    Aug 2001
    Location
    Crossroads of America
    Posts
    72
    are you using ADO? could you post your vb code?

    I assume you've successfully retrieved other recordsets from your oracle database using similar vb code...have you tried doing something like "select * from table"? This would verify that your connection string and other ADO settings are correct.

  9. #9
    Addicted Member djengiz's Avatar
    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    153
    Hi,

    i dont have an oracle database. but i think your problem is in ADO or your ODBC settings. This query should work. You might want to post the code so i can have better look.

    yours

    D

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