Results 1 to 8 of 8
  1. #1
    cowboy is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    291

    Making tables: use query or report or what?

    Simple question, I am putting together some tables to be put into a microsoft word document and needs to be able to be edited. I am going to be getting this data from several access files with several records each so I was gonna make a query that I could copy to each database. Is this the best way to go about this?

    If so in my query I want to get the greater of 2 values, I am new to queries and I can make the data in the record appear but I dont know how to evaluate between 2 numbers and choose the greater to be displayed.



    Thanks for any help

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Probably using the IIF (Immediate IF) function in your query if I understand your post correctly. VBA Help will show you how to use the function.

  3. #3
    cowboy is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    291
    I tried putting code into the SQL view in the form I would use it in VB but it didnt work, gave me an error. Is there anywhere I can get an example of formats?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It would go in your query.

  5. #5
    cowboy is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    291
    Quote Originally Posted by cowboy View Post
    I tried putting code into the SQL view in the form I would use it in VB but it didnt work, gave me an error. Is there anywhere I can get an example of formats?
    When I said that I should have used a different word other than form, it should read like;

    I tried putting code into the SQL view in the same format I would use it in VB but it didnt work, gave me an error. Is there anywhere I can get an example of formats?

    sorry about confusion

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Post the SQL view of what you have please.

  7. #7
    cowboy is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    291
    SELECT Inspections.ID, Inspections.[Manhole Number (12)], Inspections.[Manhole Type], Inspections.[Rim to Invert (13)], Inspections.[Wall Diameter], Inspections.[Wall Diameter 2], Inspections.[Additional Information (39)]
    FROM Inspections;

    and I tried

    SELECT Inspections.ID, Inspections.[Manhole Number (12)], Inspections.[Manhole Type], Inspections.[Rim to Invert (13)],
    if Inspections.[Wall Diameter]> Inspections.[Wall Diameter 2] then
    Inspections.[Wall Diameter]
    else
    Inspections.[Wall Diameter2]
    end if, Inspections.[Additional Information (39)]
    FROM Inspections;

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Try:
    SELECT ID, [Manhole Number (12)], [Manhole Type], [Rim to Invert (13)],
    IIF( [Wall Diameter] > [Wall Diameter 2], [Wall Diameter], [Wall Diameter2]) As WallDiameter, [Additional Information (39)]
    FROM Inspections;

    WARNING - AIR CODE !!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Making report for tracking production
    By winniepoohbear38501 in forum Reports
    Replies: 1
    Last Post: 01-28-2010, 09:06 PM
  2. Report from 2 tables
    By KWarzala in forum Reports
    Replies: 1
    Last Post: 11-26-2009, 09:41 AM
  3. making into update query
    By tom4038 in forum Queries
    Replies: 1
    Last Post: 09-23-2009, 11:19 AM
  4. Making report from 2 queries
    By QueeN in forum Reports
    Replies: 1
    Last Post: 04-20-2009, 01:36 PM
  5. Making a new field in a query
    By mslieder in forum Queries
    Replies: 3
    Last Post: 05-14-2008, 11:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums