Q:

SQL Query Help!  Using Selecting multiple

I am trying to query data that will allow me to use the SELECT statement to bring in multiple fields.  Below is my code: (Which works for one specific field - [PDN005_Err].  How can I stretch that from looking only at 005 to PDN005 - PDN122, without having to hard code them into there?  
Any help would be greatly appreciated! 
SELECT *
FROM OpenQuery(INSQL,
'
SELECT [DateTime], [PDN005_Err], [PDN005_Loc]
FROM Runtime.dbo. WideHistory
WHERE [DateTime] >= ''2014-03-01''
AND [DateTime] <= ''2014-04-01''
AND [PDN005_Err] = 1
ORDER BY [DateTime]
'
)

I am trying to query data that will allow me to use the SELECT statement to bring in multiple fields.  Below is my code: (Which works for one specific field - [PDN005_Err].  How can I stretch that from looking only at 005 to PDN005 - PDN122, without having to hard code them into there?  
Any help would be greatly appreciated! 
So as an UPDATE this is what I tried..
SELECT *
FROM OpenQuery(INSQL,
    '
SELECT [DateTime], [AGC005_ErrCond], [AGC003_ErrCond], [AGC005_Loc], [AGC003_Loc]
FROM Runtime.dbo. WideHistory
WHERE [DateTime] >= ''2014-03-01''
AND [DateTime] <= ''2014-04-01''
AND ([AGC005_ErrCond] = 1
OR [AGC003_ErrCond] = 1)
ORDER BY [DateTime]
    '
)

However, When I receive the data.. the value I'm looking for is 1.. however.. the data will keep repeating itself until one of the PDN Err = 1.  Here's the attached picture so you can see. 

A:

Try this:
DECLARE @data varchar(max)

;WITH x as
(
  SELECT number FROM master..spt_values WHERE number between 1 and 122 and type = 'P'
)
SELECT @data = 'SELECT [DateTime]'+ ( 
        SELECT ',[PDN'+right(cast(number+1000 as char(4)), 3) + '_Err]'
        FROM x
        for xml path(''), type 
    ).value('.', ' varchar(max)') + ',[PDN005_Loc]
FROM Runtime.dbo. WideHistory
WHERE [DateTime] >= ''''2014-03-01''''
AND [DateTime] <= ''''2014-04-01''''
AND [PDN005_Err] = 1
ORDER BY [DateTime]'

exec( 'SELECT *
FROM OpenQuery([INSQL],'''+@data + ''')')

Note I would agree with the comment from @ThorstenKettner that hardcoding the columns would be better. 
You should be aware that the maximum length of the query varchar in OpenQuery is 8 KB.