Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-28-2006, 05:48 PM   PM User | #1
N_R_D
Regular Coder

 
Join Date: Apr 2005
Posts: 129
Thanks: 0
Thanked 0 Times in 0 Posts
N_R_D is an unknown quantity at this point
Variable as criteria

PHP Code:
SELECT         B.CALACTB.CALDATB.CALTIMB.CALOPR 
INTO         
#uniquecalls2MONTHS
FROM         #UNIQUELOANSTOGETREPEATS AS A
JOIN         CONTACT.DBO.PHNLOG AS B ON (A.CALACT1=B.CALACT)
WHERE         B.CALACT >0
AND         B.CALDAT BETWEEN @startDate AND @60DayEnd
AND         B.CALTYP in (903)
AND         
B.CALLOG IN ('C','T')
GROUP BY     B.CALACTB.CALDATB.CALTIMB.CALOPR 
I would like to have

PHP Code:
declare        @superVar varchar(50)
select         @superVar 'CALTYP in (903)'

SELECT         B.CALACTB.CALDATB.CALTIMB.CALOPR 
INTO         
#uniquecalls2MONTHS
FROM         #UNIQUELOANSTOGETREPEATS AS A
JOIN         CONTACT.DBO.PHNLOG AS B ON (A.CALACT1=B.CALACT)
WHERE         B.CALACT >0
AND         B.CALDAT BETWEEN @startDate AND @60DayEnd
AND         @superVar
AND         B.CALLOG IN ('C','T')
GROUP BY     B.CALACTB.CALDATB.CALTIMB.CALOPR 
Where

AND B.CALTYP in (903)

is

AND @superVar

How would I go about coding that?
N_R_D is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:00 AM.


Advertisement
Log in to turn off these ads.