Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Crosstab Query Quandry (Access2k)

    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

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Crosstab Query Quandry (Access2k)

    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.

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crosstab Query Quandry (Access2k)

    ans,
    No difference. Its word for word.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Crosstab Query Quandry (Access2k)

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

  5. #5
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Atlanta, Georgia, USA
    Posts
    274
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Crosstab Query Quandry (Access2k)

    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?? <img src=/S/confused.gif border=0 alt=confused width=15 height=20>

    Thanks as always and have a great day,
    Scott

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Crosstab Query Quandry (Access2k)

    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.

Posting Permissions

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