| 
                
Please start any new threads on our new 
    site at https://forums.sqlteam.com.  We've got lots of great SQL Server
    experts to answer whatever question you can come up with. 
    
        | 
                
                    | 
                            
                                | Author | Topic |  
                                    | pmidgeStarting Member
 
 
                                        2 Posts | 
                                            
                                            |  Posted - 2009-06-22 : 08:29:26 
 |  
                                            | Hello.I wondered if someone could help me. I am having trouble trying to write a sql query which will select all records imported in the last week, but only those imported after a specific time.So, I have a column called import_date, and the query I have so far is - select id, email, import_date, sourcefrom advertiser_unsubscribe_logwhere import_date >= dateadd(dd, -6, getdate())order by import_dateWhich gives me everything from the last week (from last Tuesday until today). I now want to narrow down my selections even further, by selecting only records imported after 12pm last Tuesday. Any help would be great.Thanks |  |  
                                    | madhivananPremature Yak Congratulator
 
 
                                    22864 Posts | 
                                        
                                          |  Posted - 2009-06-22 : 08:37:23 
 |  
                                          | Tryselect id, email, import_date, sourcefrom advertiser_unsubscribe_logwhere import_date >=  dateadd(day, datediff(day,0, getdate())-6,'12:00:00')order by import_dateMadhivananFailing to plan is Planning to fail |  
                                          |  |  |  
                                |  |  |  |  |  |