Forum Replies Created

Viewing 15 posts - 31 through 45 (of 1,085 total)

  • RE: Day Range Caluculations

    Holy #$% Jeff!  Thanks! 

    I will mess with this tomorrow; and probably save this in my stash of code. 

  • RE: Time Difference

    Thanks!  I just could not get it through my thick head...

  • RE: NULL Data

    I am a bit surprised at these reactions to you David. This is the Newbies forum, hence it is implied that you are not aware of requirments. Try...

  • RE: Time Difference

    A timestamp is not simply a randomly generated number.  It has to be based upon some value or point in time - otherwise it would be like a GUID or...

  • RE: Day Range Caluculations

    Jeff - two questions.  [ tia ]

    1) WHERE Name IS NULL - is that specific to your Master.dbo.spt_Values table? 

    2) Does this represent your answer with a Table...

  • RE: JOIN screwing things up.

    Interesting!  Is this because a NULL returned to some GUI's causes a problem? 

    It strikes me as a poor programming technique and a NULL should be handled in the GUI...

  • RE: T-SQL Help

    I totally agree with John, but in the mean time, this should work:

    DECLARE @food TABLE( Food varchar(35), 

                                       Type varchar(35))

    INSERT INTO @food

    SELECT 'Apple|Steak|Peanut', 'Fruit|Meat|Nut'...

  • RE: JOIN screwing things up.

    Oooops... Forgot a comma. 

    SELECT U.Uname, U.UnameFirst, U.UnameLast, WE.WXlinkItemID, WC.WCid,

                 COUNT( WC.WCid) AS totWorkedDays,

                 SUM( WC.WCtaskAmount) AS totWorkedUnits,

                 SUM( WC.WCbillableAmount) AS totBilledUnits,

                 ROUND( SUM( WC.WCtaskAmount *...

  • RE: JOIN screwing things up.

    Boy, this keeps changing...    Try this, (it uses the Derived Table concept):

     

    SELECT U.Uname, U.UnameFirst, U.UnameLast, WE.WXlinkItemID, WC.WCid,

                 COUNT( WC.WCid) AS totWorkedDays,...

  • RE: JOIN screwing things up.

    I missed one of your conditions:

    SELECT SUM( WC.WCmileage) AS totMiles, WC.WCid

    FROM workcompleted WC

       INNER JOIN users U ON( U.Uname = WC.WCemployeeID) -- ?

       INNER JOIN worktask...

  • RE: JOIN screwing things up.

    I have no way of testing this, but see if this works.  BTW WHERE 1 = 1 is totally unnecssary. 

     

    SELECT SUM( WC.WCmileage) AS totMiles, WC.WCid

    FROM workcompleted WC...

  • RE: JOIN screwing things up.

    Could you post your query without the extraneous tables and alias the names so we will know what columns belong to what tables? 

    Also, you may want to provide a...

  • RE: JOIN screwing things up.

    It looks like you have multiple tables, (subjectrecord, worktask, etc.) with no alias and no join. 

    Could you write this using alias's so we can tell which columns are attached...

  • RE: not showing nulls

    Do you want to exclude the entire record is any field, (column) is NULL or just the individual NULLs? 

    If it is the individual NULLs, then use the ISNULL() function. ...

  • RE: Time Difference

    Ninja is correct.  You can convert the value to an integer and attempt seeing the difference in that fashion. 

    Here is a query showing a 24 second difference and the...

Viewing 15 posts - 31 through 45 (of 1,085 total)