Hi all,
I'm trying to amend a query on the fly, but it includes a function and i'm getting all confused with how I write it in vba so that I can change it (if that makes sense!)
Here is the sql of the query as is:
As you can see it includes double and single quotes - I want to be able to change this in vba, but i'm trying to rewrite it so that the double quotes aren't seen as terminating the string etc & it's not working
Any help would be appreciated!
Thanks, leddy
I'm trying to amend a query on the fly, but it includes a function and i'm getting all confused with how I write it in vba so that I can change it (if that makes sense!)
Here is the sql of the query as is:
Code:
SELECT DISTINCT tempExport.ROUNDCODE, tblpafdata.Str, tblpafdata.PCD, tempExport.NDP, Concatenate("SELECT DISTINCT ORG & PRMNUM & iif(PRMNUM='' OR IsNull(PRMNUM),NUMRANGE,'') AS N FROM tblpafdata WHERE PCD = '" & [PCD] & "'") AS [Num Range]
FROM tempExport INNER JOIN tblpafdata ON tempExport.postcode = tblpafdata.PCD
WHERE (((tempExport.ROUNDCODE) Is Not Null));
As you can see it includes double and single quotes - I want to be able to change this in vba, but i'm trying to rewrite it so that the double quotes aren't seen as terminating the string etc & it's not working

Any help would be appreciated!

Thanks, leddy