Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I don't understand the need for all the concatenation and quotes. Do either of these do what you want? The second is only needed if there are duplicates:

    BuildStr("SELECT [FileNam] FROM Folders ORDER BY [SortKey]"," ")


    BuildStr("SELECT [FileNam] FROM Folders GROUP BY [FileNam], Folders.[SortKey] ORDER BY [SortKey]"," ")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  2. #17
    shank is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    188
    The reason for the quotes encapsulating the filenames is for another process down the line. The end result will look like below. After more grooming, I will export this out to a text file, rename it to a batch file, then assemble several PDFs into one PDF.

    "Invoice Summary 646733 102019-102619.pdf" "Sold Qty 646733 102019-102619.pdf" "Available Qty 646733 102019-102619.pdf" "Returns 646733 102019-102619.pdf" "PA Invoice Reports 646733 102019-102619.pdf" "Invoice Breakout 646733 102019-102619.pdf"

    The latter statement is closer to my needs. I just need to figure out getting the quotes correct. I suppose I could use another temp table and groom that. I was just trying to figure this out in one step.

    Thanks!

  3. #18
    shank is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    188
    Bloody hell! You had it! I took your statement and did some experimenting and this gives me what I wanted.

    BuildStr("SELECT '""' & [FileNam] & '""' FROM Folders GROUP BY [FileNam], Folders.[SortKey] ORDER BY [SortKey]"," ")

    I never would have gotten this without your help!

    Very much appreciated!

    Thanks!

  4. #19
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help! I get the quotes now. I probably would have done it in the function, though I suppose doing it in the SQL leaves the function more flexible.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #20
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    By the way, I'm curious how you assemble multiple PDF files into one?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Syntax issue with Function
    By Cafe2UEMP in forum Programming
    Replies: 5
    Last Post: 12-27-2017, 01:14 PM
  2. Convert SQL Server Syntax To Access Query Syntax
    By chalupabatman in forum Queries
    Replies: 1
    Last Post: 10-18-2017, 08:53 PM
  3. Replies: 5
    Last Post: 01-08-2015, 02:08 PM
  4. Replies: 2
    Last Post: 02-26-2014, 05:06 PM
  5. syntax issue when searchin dates
    By mike02 in forum Programming
    Replies: 1
    Last Post: 07-10-2013, 10:09 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