on 11-26-2011 3:23 PM
I want to write query which returns list of Sales opportunities between 2 inut dates - result must include number of days between date of stage 1 (enquiry stage) and date of Stage 2 (quotation stage)
Is this possible using DateDiff() function? How can I get date of stages?
Karen
Hi,
Try this first:
SELECT T1.[OpprId], T1.[Name], T1.[OpenDate], T1.[CloseDate],
datediff(dd,T1.[OpenDate],T1.[CloseDate]) '# of days'
FROM OOPR T1
WHERE T1.[OpenDate] > [%0] AND T1.[CloseDate] < [%1]
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andrew,
Try to use the below query for your further modification
SELECT T1.[OpprId], T1.[Name], T0.[OpenDate], T0.[CloseDate],
datediff(dd,T0.[OpenDate],T0.[CloseDate]),
T2.[Descript] FROM OPR1 T0 INNER JOIN OOPR T1 ON T0.OpprId = T1.OpprId INNER JOIN OOST T2 ON T0.Step_Id = T2.Num
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.