Future Package Use

This query is useful if you need to determine how many times packages are being rented within a certain period of time.  This is considered a more advanced query as you will need to adjust the date and or product code as you needs change.

*Note if you are looking for a particular product code you could replace  (M.product_Config = '1') with it.product_code_v42 = 'ampfb'  with ampfb being the product code you are looking for.

You can also change the order they appear using the ORDER BY line.

Sample output


Product Code
Product DescriptionBookingStart DateReturned DateQtyCompanyShowName
AMPFB   D&B B1 F2 amp rack                                COLO020003012-06-0112-07-091ColourBackground and Screen Audio
BMTTM   Barco Mitrix Touring Module                       TEMP010122912-06-0112-06-1436TEMP  CLIENTLED Screen - BBC Television Centre
AMPFB   D&B B1 F2 amp rack                                PRES0049812-06-1512-09-174Charter LimitedDRYHIRE - Medium PA for 100
GXWPE   Watchout Production Equipment                     TEMP010154212-07-0112-09-301TEMP  CLIENTOlympic Cinema
GXWDC   Watchout Display Channels                         TEMP010154212-07-0112-09-303TEMP  CLIENTOlympic Cinema
MACPRO  Apple MacPro / Playback Pro                       ALB0001012-07-0512-07-081ProductionsJuly 2012 Event - Video
MACPRO  Apple MacPro / Playback Pro                       ALB0001012-07-0512-07-081ProductionsJuly 2012 Event - Video


SELECT    IT.product_code_v42 AS [Product Code],

        M.descriptionV6 AS [Product Description],

        IT.booking_no_v32 AS Booking,

        B.dDate AS [Start Date],

        B.rDate AS [Returned Date],

        IT.trans_qty AS Quanity,

        B.OrganizationV6 As Company,

        B.showName


FROM         dbo.tblItemtran AS IT INNER JOIN

                      dbo.tblbookings AS B ON IT.booking_no_v32 = B.booking_no LEFT OUTER JOIN

                      dbo.tblInvmas AS M ON IT.product_code_v42 = M.product_code


WHERE     (M.product_Config = '1')

                   AND (B.dDate > '2012-05-01')

                   AND (B.dDate < '2012-07-31')


ORDER BY [Product Code], [Start Date]