User Profile

Collapse

Profile Sidebar

Collapse
gbarcalow
gbarcalow
Last Activity: Nov 28 '07, 09:13 PM
Joined: Sep 6 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • gbarcalow
    replied to Adv. SQL Query Help
    Here is my working query, Thanks again


    Code:
    select groupNum ,count(a.voicemail) 'voicemailCount', 
    	( select count(*) 
    	  from ( select a.itemid,a.groupnum,a.created,b.started,b.voicemail,b.department 
    		 from csrt_items a inner join call b on a.itemid=b.itemid ) b
    	  where b.groupnum=a.groupnum and datediff(n,b.voicemail,b.started)>60 
    	  and convert(varchar(10), b.started, 111) = convert(varchar(10),
    ...
    See more | Go to post

    Leave a comment:


  • gbarcalow
    started a topic Adv. SQL Query Help

    Adv. SQL Query Help

    I know how to get the results I want with two queries, but would like to use only one query. The following is as abbreviated and concise as possible.

    My first table [Items] contains two relevant fields:
    ItemID (int) and GroupNum (varchar).
    The second table [Call] contains three relevent fields:
    ItemID (int), Started (smalldatetime) , Voicemail (smalldatetime) .

    These are the results I would like:...
    See more | Go to post
No activity results to display
Show More
Working...