Results 1 to 2 of 2
  1. #1
    Tyork is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Oct 2010
    Posts
    35

    Concatenate FROM Clause

    I'd like to use the left, mid and right functions to populate information in the FROM clause of the following query portion.



    Code:
     
    FROM LetterEval & LEFT(Forms!LA_Main!ReportDate,2) & MID(Forms!LA_Main!ReportDate,4,2) & RIGHT(Forms!LA_Main!ReportDate,4)
    I would like to use the query as the basis of a report but can't seem to get the correct syntax. Is this possible?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Hi

    If you are creating a SQL string as the basis for a recordset, then the following syntax should work:

    "FROM LetterEval " & LEFT(Forms!LA_Main!ReportDate,2) & " " & MID(Forms!LA_Main!ReportDate,4,2) & " " & RIGHT(Forms!LA_Main!ReportDate,4) & ";"

    Hope this helps

    Regards
    Bob

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

Similar Threads

  1. Using the TOP clause
    By WSlepecki in forum Queries
    Replies: 1
    Last Post: 04-08-2011, 06:59 AM
  2. concatenate
    By stephenaa5 in forum Programming
    Replies: 2
    Last Post: 10-11-2010, 05:18 PM
  3. Concatenate Formula
    By Shingo in forum Programming
    Replies: 1
    Last Post: 07-25-2009, 09:14 AM
  4. IIF clause
    By Peljo in forum Queries
    Replies: 2
    Last Post: 02-05-2008, 11:22 AM
  5. Help on WHERE clause
    By QBCM in forum Programming
    Replies: 1
    Last Post: 12-19-2005, 08:43 PM

Tags for this Thread

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