Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)

  • RE: how to group by following column and get the maxvalue?

    name value zone

    CA129R 2748 East

    CA129R 543 west

    CA129R 3000 north

    CA129R 100 south

    ....

    required output:

    name value zone

    CA129R 3000 north

    Answer:

    select * from TestZone where value=3000

    (or)

    select * from Testzone where value LIKE '%300%'

    hope this...

  • RE: Date Differnces

    Date1 is the lower date. Date2 is greater. This formula does NOT account for date1 being greater than date2.

    Declare @Date1 Datetime

    Declare @Date2 Datetime

    Select @Date1 = Orders.Prom_Ship_date

    Select @Date2 = Orders.Actual_Ship_date

    Select datediff(dd,@Date1,@date2),datepart(dd,@date1),datepart(dw,@date1)

    --...

Viewing 2 posts - 1 through 2 (of 2 total)