• zawhtway (8/21/2010)


    Hi,

    I am very new and never write a TSQL code before. I started learning from yesterday.

    I have those tables.

    Holiday

    - HolidayDate

    All the Holiday dates in a year will be populated.

    Routes

    - RouteID(Identity), StaffID, SatDayDelivery(bit)

    Pickup

    - PickUpID(Identity), RouteID, StaffID, PickupDate

    What I want to do is ---

    1) Copy all records from Routes to Pickup in every weekdays.

    2) And copy the (SatDayDelivery = True) records on Friday or the day before Holiday.

    After learning I know how to copy the data but I don't know how to do complex things. Still learning..

    Any help will be greatly appreciated.

    rgds,

    zhtway

    My recommendation is to learn the basics before trying to do such a thing. You can do that at sites like w3Schools.com .

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)