January 28, 2010 at 1:00 pm
Hi,
I have a query thats brings me:
dsCallId Piloto
---------- ---------------------------------
1005833038ACD_EPMBOGOTA_VENTAS_COMERCIAL
1005833038Leidy Tatiana Montes Acevedo
1005833888ACD_EPMBOGOTA_VENTAS_COMERCIAL
1005833888Leidy Tatiana Montes Acevedo
1005834868ACD EPM Bogota Ventas
1005834868Deisy Carolina Presiga Bustamante
1005835307ACD_EPMBOGOTA_VENTAS_COMERCIAL
1005836847ACD EPM Bogota Ventas
1005837669ACD EPM Bogota Ventas
1005837669Edison Alexis Neira Cadavid
the columns dsCallId and Piloto are varchar.
Im using the following code to get the data above.
Select distinct A.dsCallId, A.Piloto
From
(
Select
dsCallId,
Piloto
From
SPS01_CALLBACK.[DB_Callback_CM].[dbo].[tbl_Datos_LLamadaEntrantesEPMBog]
Where
fechaLlamada between '2010-01-22' and '2010-01-22 12:00:00'
and dsCallId not in ('') and Piloto not in ('')
) A,
(
Select
CALLID as Identificador
From
DB_Recordges.dbo.History_recordges
Where
recordingdate between '2010-01-22' and '2010-01-22 12:00:00'
and
assignedworkgroup in ('NA','Not Found','Timed out or not in queue')
) B
Where
A.dsCallId = B.Identificador COLLATE Latin1_General_CI_AS
I need a query to to bring me the data like this:
dsCallId Piloto
---------- ---------------------------------
1005833038ACD_EPMBOGOTA_VENTAS_COMERCIAL
1005833888ACD_EPMBOGOTA_VENTAS_COMERCIAL
1005834868ACD EPM Bogota Ventas
1005835307ACD_EPMBOGOTA_VENTAS_COMERCIAL
1005836847ACD EPM Bogota Ventas
1005837669ACD EPM Bogota Ventas
thank you any help to solve this.
January 28, 2010 at 1:11 pm
Are you sure that your statement is correct? You don't use "B" anywhere. (BTW: Try to get rid of this old join-style)
Greets
Flo
January 28, 2010 at 1:14 pm
add
AND A.Piloto LIKE 'ACD%'
to your WHERE clause.
If that's not what you're looking for please provide sample data and expected results as described in the first link in my signature.
@Flo: Glad to see you around again! Where have you been?
January 28, 2010 at 1:19 pm
Hey Lutz!
lmu92 (1/28/2010)
@Flo: Glad to see you around again! Where have you been?
Been busy last time. It's always hard for a (primary) .net-dev to stay too much in sql. It's my passion :-P, sadly, not my primary business and I had to get up-to-date with some new .net stuff. I still have to...
Also didn't feel very well in my current company. Tomorrow I'll quit my contract and in three month I'm away from there 😀
Greets
Flo
January 28, 2010 at 1:32 pm
lmu92 (1/28/2010)
addto your WHERE clause.
AND A.Piloto LIKE 'ACD%'
If that's not what you're looking for please provide sample data and expected results as described in the first link in my signature.
@Flo: Glad to see you around again! Where have you been?
Thank You all, Thank you lmu92 that should do the trick.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply