Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    learning_graccess is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2011
    Posts
    40
    Thank you. But still it displays as [Afternoon, Evening, Morning, Night]. I put the below code

    select [day] & "April," [period]
    order by tbldays.id, tblperiods.period



    My table contains id and id1 in place of dSeq and pSeq

  2. #17
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    This code

    select [day] & "April," [period]
    order by tbldays.id, tblperiods.period
    has invalid syntax... There is no FROM table name(s)

  3. #18
    RagJose is offline Seasoned user
    Windows XP Access 2002
    Join Date
    Apr 2012
    Location
    Brazil
    Posts
    42
    Quote Originally Posted by learning_graccess View Post
    ...it displays as [Afternoon, Evening, Morning, Night]. I put the below code

    select [day] & "April," [period]
    order by tbldays.id, tblperiods.period

    My table contains id and id1 in place of dSeq and pSeq
    Substitute "order by tbldays.id, tblperiods.id1" in the last line. As "orange" pointed out, your query needs also a FROM line, but I understand you have just left it out for the purpose of this post.

  4. #19
    learning_graccess is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2011
    Posts
    40
    Quote Originally Posted by RagJose View Post
    Substitute "order by tbldays.id, tblperiods.id1" in the last line. As "orange" pointed out, your query needs also a FROM line, but I understand you have just left it out for the purpose of this post.
    order by tblperiods.id1, tblperiods.period gives the following output
    1st April, morning
    2nd April, morning
    3rd April, Morning
    1st April, Afternoon
    2nd April, Afternoon
    etc.

    So finally i conclude it might not be possible to get data as I wanted in first post using query in access. I will have do it manually anyway.

  5. #20
    RagJose is offline Seasoned user
    Windows XP Access 2002
    Join Date
    Apr 2012
    Location
    Brazil
    Posts
    42
    Guess we are having a communication barrier here... Try copying and pasting the following:

    SELECT [day] & " April, ", [period]
    FROM tblDays, tblPeriods
    ORDER BY tbldays.id, tblperiods.id1;


    If you do it correctly, it will give you exactly what you want.

  6. #21
    learning_graccess is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2011
    Posts
    40
    Wow, finally it worked. Thanks mate.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 12-20-2011, 07:33 AM
  2. Replies: 1
    Last Post: 12-16-2011, 08:16 AM
  3. How to loop code to run through entire table
    By kmajors in forum Reports
    Replies: 9
    Last Post: 04-23-2010, 09:27 AM
  4. Create table out of union query
    By DKruse1969 in forum Queries
    Replies: 2
    Last Post: 08-28-2009, 09:55 AM
  5. Loop a table to use field in query
    By jdubp in forum Programming
    Replies: 0
    Last Post: 03-04-2008, 11:48 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