P
Paul Dennis
I have the following SQL in a module which I'm having problems with. I am
trying to concatinate [Last Name] and [First Name] and since the full
statement must have " I have tried to use '' (2 single ' together), however
the sql doesn't work. If I remove the & '' & and replace with [Last Name] &
[Firstr Name] it still doesn't work If however I leave it as [Last Name] then
it does work, so it's just a syntax problem. Just I say, more like a royal
pain.
I have the syntax in 2 places, the select and the group by. Can you help.....
SQLCalcsub = "INSERT INTO [Temp - Position - Riderssub] " & _
"( Rider_ID, Name, YrLessThan, [Year], Total, Points, Bonus
) " & _
"SELECT [Meeting Riders].Rider_ID, [Last Name] & '' '' &
[First Name] AS Name, " & _
"[lngCurrYear] AS YrLessThan, Left([Meeting Number],4)+1 AS
[Year], " & _
"Sum([Meeting Riders].Points+[Meeting Riders].Bonus) AS
Total, " & _
"Sum([Meeting Riders].Points) AS Points, Sum([Meeting
Riders].Bonus) AS Bonus" & _
"GROUP BY [Meeting Riders].Rider_ID, [Last Name] & [First
Name], [lngCurrYear], Left([Meeting Number],4)+1 "
trying to concatinate [Last Name] and [First Name] and since the full
statement must have " I have tried to use '' (2 single ' together), however
the sql doesn't work. If I remove the & '' & and replace with [Last Name] &
[Firstr Name] it still doesn't work If however I leave it as [Last Name] then
it does work, so it's just a syntax problem. Just I say, more like a royal
pain.
I have the syntax in 2 places, the select and the group by. Can you help.....
SQLCalcsub = "INSERT INTO [Temp - Position - Riderssub] " & _
"( Rider_ID, Name, YrLessThan, [Year], Total, Points, Bonus
) " & _
"SELECT [Meeting Riders].Rider_ID, [Last Name] & '' '' &
[First Name] AS Name, " & _
"[lngCurrYear] AS YrLessThan, Left([Meeting Number],4)+1 AS
[Year], " & _
"Sum([Meeting Riders].Points+[Meeting Riders].Bonus) AS
Total, " & _
"Sum([Meeting Riders].Points) AS Points, Sum([Meeting
Riders].Bonus) AS Bonus" & _
"GROUP BY [Meeting Riders].Rider_ID, [Last Name] & [First
Name], [lngCurrYear], Left([Meeting Number],4)+1 "