| 
                
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 |  
                                    | dougancilPosting Yak  Master
 
 
                                        217 Posts | 
                                            
                                            |  Posted - 2010-08-19 : 15:21:07 
 |  
                                            | I have a few queries that were written by another developer that I need converted to SQL. An example is below:SELECT [1_1Employee].Last_First_Name, [1_1Employee].Employee_Number, Format$((([Timestamp]-(([LoggedIn]/1000)/60))/1440)+1,"mm/dd/yy") AS [Date], Format$((([Timestamp]-(([LoggedIn]/1000)/60))/1440)+1,"dddd") AS [Day], Sum(([LoggedIn]/1000/60)) AS LogIn, Sum(([OnTime]/1000/60)) AS OnTime1, Format$((([Timestamp]-(([LoggedIn]/1000)/60))/1440)+1,"yy/mm/dd") AS Da INTO 1_1ScratchPad FROM 1_1Employee INNER JOIN do_mOpLogout ON 1_1Employee].Employee_Login = dbo_mOpLogout.OpnameCan anyone offer the best way to do this? Thank youDoug |  |  
                                    | slimt_slimtAged Yak Warrior
 
 
                                    746 Posts | 
                                        
                                          |  Posted - 2010-08-19 : 16:07:12 
 |  
                                          | can you provide also your table 1_1Employee definition, because of the date formatings. |  
                                          |  |  |  
                                    | madhivananPremature Yak Congratulator
 
 
                                    22864 Posts | 
                                        
                                          |  Posted - 2010-08-20 : 05:06:59 
 |  
                                          | Read about CONVERT function in SQL Server help fileMadhivananFailing to plan is Planning to fail |  
                                          |  |  |  
                                    | dougancilPosting Yak  Master
 
 
                                    217 Posts | 
                                        
                                          |  Posted - 2010-09-02 : 13:55:10 
 |  
                                          | Slimt, I don't have the table1_1Employee definition. In SQL the data is written in seconds. The field name is called Ontime and it's set as a decimal value. |  
                                          |  |  |  
                                    | jimfMaster Smack Fu Yak Hacker
 
 
                                    2875 Posts | 
                                        
                                          |  Posted - 2010-09-02 : 14:46:28 
 |  
                                          | Can you give an example of what timestamp and loggedin look like in your table and what they represent and what you expect for the output?JimEveryday I learn something that somebody else already knew |  
                                          |  |  |  
                                    | dougancilPosting Yak  Master
 
 
                                    217 Posts | 
                                        
                                          |  Posted - 2010-09-03 : 14:33:14 
 |  
                                          | Everyone, I think that for now, I'm just going to abandon the idea of converting these queries though I'm sure that I will have to use the mathematic equation at some point. I do have another question but I'm going to open another topic for that. Thanks |  
                                          |  |  |  
                                |  |  |  |  |  |