No buddy, how do you do it in TSQL for a stored procedure:)

----- Original Message ----- 
From: "Venable, John" <[EMAIL PROTECTED]>
To: "SQL" <[email protected]>
Sent: Thursday, February 24, 2005 11:24 AM
Subject: RE: How do you do an IF condition in where statement


> You need single quotes around your values.
>
> i.e. lastname='#form.lastname#'
>
> John Venable
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, February 24, 2005 2:26 PM
> > To: SQL
> > Subject: How do you do an IF condition in where statement
> >
> > How would you write this regular Cold Fusion query in TSQL for a
> > stored
> > procedure:
> >
> > select *
> > from profiles
> > where 0=0
> > <cfif form.firstname neq ''>and
> > firstname=#form.firstname#</cfif> <cfif form.lastname neq ''>and
> > lastname=#form.lastname#</cfif> <cfif form.phone neq ''>and
> > phone=#form.phone#</cfif>
> >
> > I tried a few times, I can't quite get the hang of IF statements in
> > TSQL for some reason, even tho. in CFMX they're juz a piece of cake.
> >
> > Thanks,
> > Pardeep.
> >
> >
> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:6:2172
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/6
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:6
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.6
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to