• Crosstab Query Quandry (Access2k)

    Author
    Topic
    #388593

    I’m creating a crosstab query in code using CreateQueryDef. The query is created with no problems.
    When the query is run it doesn’t return all the results I expect.
    If I open the query that was created in design view and edit anything in the grid without re-running the query(ie ascending to descending and back to ascending)
    Then run the query all the expected results are shown.
    Does anyone know why this would happen.
    Thanks,
    Scott

    Viewing 0 reply threads
    Author
    Replies
    • #682901

      Can you detect a difference in the SQL before and after the “dummy” edits? You can paste the SQL into Word or a text editor to make comparison easier.

      • #682907

        ans,
        No difference. Its word for word.

        • #682915

          I’ll try some tests later today; perhaps you can post the relevant part of the code that creates the query?

          • #682922

            Hans,
            Thanks.
            I went back farther in the code and a create table query wasn’t properly creating a “date” data type in the table.
            Fixed that and the problem went away.
            I’m still not sure why the query would work when edited?? confused

            Thanks as always and have a great day,
            Scott

            • #682928

              When you create a query in code, you are only creating the SQL.
              If you open the query in design view and edit something, you force Access to “rethink” it. How exactly, I don’t know, but apparently that was enough.

    Viewing 0 reply threads
    Reply To: Crosstab Query Quandry (Access2k)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: