Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Blank Row Between Dates

Status
Not open for further replies.

charbrad

Technical User
Nov 7, 2002
132
US
I have the below code and I am trying to insert a blank row when the date changes (column early_shpdte). I have tried multiple things such as char(13)+ char(10) but nothing works. I am just a beginner trying to master this skill. Can someone help me out?

Code:
SELECT CASE 
         when ship.shpsts = 'I' and DateDiff(Day, 0, shipment.early_shpdte) <= DateDiff(Day, 0, GetDate()) then 'Picked'
         when ship.shpsts = 'I' and DateDiff(Day, 0, shipment.early_shpdte) = DateDiff(Day, 0, GetDate()) +1 then 'Picking'
         when ship.shpsts = 'I' and DateDiff(Day, 0, shipment.early_shpdte) > DateDiff(Day, 0, GetDate()) +1 then 'Allocated'
         when ship.shpsts = 'L' then 'Loading'
         when ship.shpsts = 'S' then 'Staged'
         when ship.shpsts = 'C' then 'Shipped' end shpsts, ship.ship_id, shipment.alcdte, convert(varchar,stgdte,101)as stgdte, shipment.early_shpdte,
    line.inpqty, line.stgqty, ord_line.prtnum, ord_line.host_ordqty, ord_line.pckqty,
    ord.cponum, adrmst.adrnam
FROM
    { oj (((XXx.dbo.shipment shipment INNER JOIN XXx.dbo.line ship_line ON
        ship.ship_id = shipment_line.ship_id)
     INNER JOIN dlx.dbo.ord_line ord_line ON
        shipment_line.client_id = ord_line.client_id AND
    shipment_line.ordnum = ord_line.ordnum AND
    shipment_line.ordlin = ord_line.ordlin AND
    shipment_line.ordsln = ord_line.ordsln)
     INNER JOIN dlx.dbo.ord ord ON
        ord_line.client_id = ord.client_id AND
    ord_line.ordnum = ord.ordnum)
     INNER JOIN dlx.dbo.adrmst adrmst ON
        ord.st_adr_id = adrmst.adr_id}
WHERE
    (ship.ship_id NOT LIKE 'RT%' AND
    ship.ship_id NOT LIKE 'JUG%') AND
    (shipment.stgqty = 0 AND
    ord_line.pckqty = 0 OR shipment_line.inpqty = 0) AND
    shipment.alcdte > {ts '2007-05-21 00:00:00.00'} AND
    (ship.shpsts = 'S' OR
    ship.shpsts = 'R' OR
    ship.shpsts = 'I' OR
    ship.shpsts = 'B')
 
This is a SELECT statement. You're not INSERTing anything here.

It sounds to me as if you wish to display a break between the record groupings. That should be handled in the user interface.

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
Pity the insomniac dyslexic agnostic. He stays up all night, wondering if there really is a dog.
 
Yes, wrong terminology...I wish to display a break between the date groupings. I am not sure what you mean when you say that it should be handled in the user interface.
 
Thanks SQLDenis...so there is no way to do this from within the select statement?
 
the front end application being used is classic asp...I will need to research how to get this done...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top