Forum Replies Created

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

  • RE: Day Range Caluculations

    Holy #$% Jeff!  Thanks! 

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

    I wasn't born stupid - I had to study.

  • RE: Time Difference

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

    I wasn't born stupid - I had to study.

  • 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...

    I wasn't born stupid - I had to study.

  • 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...

    I wasn't born stupid - I had to study.

  • 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...

    I wasn't born stupid - I had to study.

  • 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...

    I wasn't born stupid - I had to study.

  • 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'

    UNION ALL

    SELECT 'Orange|Cashew|Corn|Chicken',...

    I wasn't born stupid - I had to study.

  • 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 *...

    I wasn't born stupid - I had to study.

  • 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,...

    I wasn't born stupid - I had to study.

  • 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...

    I wasn't born stupid - I had to study.

  • 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...

    I wasn't born stupid - I had to study.

  • 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...

    I wasn't born stupid - I had to study.

  • 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...

    I wasn't born stupid - I had to study.

  • 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. ...

    I wasn't born stupid - I had to study.

  • 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...

    I wasn't born stupid - I had to study.

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