House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

How do you concatanate two table fields in CFQUERY with MS Access

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Hey all,
Angel Stewart
05/14/04 09:42 P
Sql uses +
Sandy Clark
05/14/04 10:21 P
Try atfname || ' ' || atlname AgentName
Jim Louis
05/14/04 10:23 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Angel Stewart
05/14/2004 09:42 PM

Hey all, I need some help with MSAccess SQL statements. This code throws the error: Too Few Parameters SELECT tblusers.username, tblJobSeekers.jsfname, tblJobSeekers.jslname, tblJobSeekers.jsemail, tblJobSeekers.jscountry, tblJobSeekers.pverify, tblJobSeekers.jsphone1, [atfname] & " " & [atlname] AS AgentName FROM tblAgent INNER JOIN (tblusers INNER JOIN tblJobSeekers ON tblusers.userid = tblJobSeekers.userid) ON tblAgent.atid = tblJobSeekers.agentid ORDER BY tblJobSeekers.jslname; >From this you can see that I want to concatenate the atfname and atlname fields into one field and call it Agent Name. There's a reason I need to have one column with this value rather than do it later when I'm displaying the data, its for use with a custom tag. Can anyone suggest why I'm getting this error, and what should be the correct syntax? This particular query works perfectly from within MS Access itself. -Gel

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Sandy Clark
05/14/2004 10:21 PM

Sql uses +   & is the CF concatenation. Silly gel.   _____ Sent: Friday, May 14, 2004 9:40 PM To: CF-Talk Subject: How do you concatanate two table fields in CFQUERY with MS Access Hey all, I need some help with MSAccess SQL statements. This code throws the error: Too Few Parameters SELECT tblusers.username, tblJobSeekers.jsfname, tblJobSeekers.jslname, tblJobSeekers.jsemail, tblJobSeekers.jscountry, tblJobSeekers.pverify, tblJobSeekers.jsphone1, [atfname] & " " & [atlname] AS AgentName FROM tblAgent INNER JOIN (tblusers INNER JOIN tblJobSeekers ON tblusers.userid = tblJobSeekers.userid) ON tblAgent.atid = tblJobSeekers.agentid ORDER BY tblJobSeekers.jslname; >From this you can see that I want to concatenate the atfname and atlname fields into one field and call it Agent Name. There's a reason I need to have one column with this value rather than do it later when I'm displaying the data, its for use with a custom tag. Can anyone suggest why I'm getting this error, and what should be the correct syntax? This particular query works perfectly from within MS Access itself. -Gel   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Jim Louis
05/14/2004 10:23 PM

Try atfname || ' ' || atlname AgentName I got that from my teaching yourself sql in 21 days book p 54. Jim Louis Best Meetings Inc. >Hey all, ----- Excess quoted text cut - see Original Post for more -----

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Sandy Clark
05/15/2004 09:57 AM

tblJobSeekers.pverify,tblJobSeekers.jsphone1 [atfname] + " " + [atlname] AS AgentName Looks like you are missing a comma after .jsphone]   _____ Sent: Saturday, May 15, 2004 6:15 AM To: CF-Talk Subject: FW: How do you concatanate two table fields in CFQUERY with MS Access Well Sandy...I tried that initially but it just didn't work. So I thought I was doing something totally wrong and that Access SQL uses something beside the +. But! Good news! I tried that code in an SQL Statement with nothing else but Select atfname + ' ' + atlname AS Agentname FROM tblagent And it worked fine. So there must be something else in the syntax of SELECT tblusers.username, tblJobSeekers.jsfname, tblJobSeekers.jslname,tblJobSeekers.jsemail, tblJobSeekers.jscountry, tblJobSeekers.pverify,tblJobSeekers.jsphone1 [atfname] + " " + [atlname] AS AgentName FROM tblAgent INNER JOIN (tblusers INNER JOIN tblJobSeekers ON tblusers.userid = tblJobSeekers.userid) ON tblAgent.atid = tblJobSeekers.agentid ORDER BY tblJobSeekers.jslname; That's causing it to fail. *sigh* I hate syntax errors. And I don't understand why the MSACcess SQL string failed to work. Could someone explain that? Thanks for the help :) -Gel Access From: "Sandy Clark" Date: Fri, 14 May 2004 22:18:07 -0400 Thread: http://www.houseoffusion.com/cf_lists/index.cfm/method=messages&threadid =32529&forumid=4#163293 Sql uses +   & is the CF concatenation. Silly gel.   _____   _____  


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

September 09, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30