Need help with query

  • Hi, I'm trying to write a query that will create a  field name/value pair list of data from a table (eventually to become a .csv file.  I only want to list the field and contents if the value is not null.  For example if i have a table with the following fields and data:

    id  char(10)   1234567890

    fname varchar(20) John

    minitial char(1)  null

    lname varchar(20) Smith

    For this record I would like to create output like this:

    id,1234567890,fname,John,lname,Smith

    Any ideas would be greatly appreciated.

     

  • ... + ISNULL(FieldName+ ','+FieldValue, '')

    _____________
    Code for TallyGenerator

  • Thanks for the help...not sure why I was struggling over this one.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply