July 23, 2009 at 11:03 am
Hi,
I want to concatenate fields from a table into a combo box. I entered the following SQL Select statement:
SelectCommand="SELECT Project + ' ' + Task + ' ' + [Sub Task] + ' ' + Description AS RAS FROM RAS_Codes">
The [Sub Task] field has empty rows and when the query returns the results it omits all of the rows in which [Sub Task] is empty.
How do I get the query to return all of the rows - even those with no values in fields?
Thank you,
John
July 23, 2009 at 11:29 am
inliten (7/23/2009)
Hi,I want to concatenate fields from a table into a combo box. I entered the following SQL Select statement:
SelectCommand="SELECT Project + ' ' + Task + ' ' + [Sub Task] + ' ' + Description AS RAS FROM RAS_Codes">
The [Sub Task] field has empty rows and when the query returns the results it omits all of the rows in which [Sub Task] is empty.
How do I get the query to return all of the rows - even those with no values in fields?
Thank you,
John
SelectCommand="SELECT Project + ' ' + Task + ' ' + isnull([Sub Task],'') + ' ' + Description AS RAS FROM RAS_Codes">
July 23, 2009 at 7:03 pm
Duplicate post also answered at the following...
http://www.sqlservercentral.com/Forums/Topic758447-9-1.aspx#bm758462
--Jeff Moden
Change is inevitable... Change for the better is not.
July 24, 2009 at 5:15 am
Ms. Pettis,
Thank you very much for your reply. I did the following and it works fine.
SelectCommand="SELECT Project + ' - ' + Task + ' - ' + Iif(isnull(SubTask),' (No Sub Task) ',SubTask) + ' - ' + Description AS RAS FROM RAS_Codes">
John
July 24, 2009 at 5:16 am
Mr. Moden,
Thank you very much. I did the following.
SelectCommand="SELECT Project + ' - ' + Task + ' - ' + Iif(isnull(SubTask),' (No Sub Task) ',SubTask) + ' - ' + Description AS RAS FROM RAS_Codes">
John
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply