but query retrieves all time the 'tblnews.intNewsID' IDLabel. I'll need the name of the ID column to redirect user to correct page. If ID came from tblNews redirect to News page.
If ID came from tblcontent redirect to Content page.
Thanks once again.
----- Original Message -----
From: Scott Weikert <[EMAIL PROTECTED]>
Date: Sat, 13 Mar 2004 13:14:42 -0700
To: CF-Talk <[EMAIL PROTECTED]>
Subject: Re: Getting the columns name in CF query
Maybe put in a bogus column that you populate yourself? i.e.
SELECT
N.intNewsID ID,
'intNewsID' as IDLabel,
etc.
UNION
SELECT
C.intContentNr ID,
'intContentNr' as IDLabel,
etc etc.
Then each row in your recordset would have that field name in IDLabel
accordingly. I believe. :)
At 12:58 PM 3/13/2004, you wrote:
>Hi all. How to get da real name of ID colum alias name when retrieving
>data from a CF query? It's possible?
>SELECT
> N.intNewsID ID,
> N.strNewsTit Title,
> N.strNewsGrav Grav,
> N.memoNewsContent Content,
> N.dtNewsDateInc DateInc,
> S.strSiteName SiteName
>FROM
> tblsite S
> INNER JOIN tblnews N ON (S.strSiteID = N.strSiteID)
>WHERE S.strSiteID='#siteID#'
>AND N.intNewsStatus=1
>AND
>#PreserveSingleQuotes(booleansearch)#
>
>UNION
>
>SELECT
> C.intContentNr ID,
> C.strTitle Title,
> C.strGrav Grav,
> C.memoContnt Content,
> C.dtInc DateInc,
> S.strSiteName SiteName
>FROM
> tblcontent C
> INNER JOIN tblsite S ON (C.strSiteID = S.strSiteID)
>WHERE S.strSiteID='#siteID#'
>AND
>#PreserveSingleQuotes(booleansearch2)#
>
>ORDER BY DateInc DESC
>
>I'll need the real column name for N.intNewsID ID and C.intContentNr ID.
>
>Thanx in advance.
>
>SWD
>
>--
>___________________________________________________________
>Sign-up for Ads Free at Mail.com
>http://promo.mail.com/adsfreejump.htm
>
>----------
>[
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

