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 Description | Booking | Start Date | Returned Date | Qty | Company | ShowName |
AMPFB | D&B B1 F2 amp rack | COLO0200030 | 12-06-01 | 12-07-09 | 1 | Colour | Background and Screen Audio |
BMTTM | Barco Mitrix Touring Module | TEMP0101229 | 12-06-01 | 12-06-14 | 36 | TEMP CLIENT | LED Screen - BBC Television Centre |
AMPFB | D&B B1 F2 amp rack | PRES00498 | 12-06-15 | 12-09-17 | 4 | Charter Limited | DRYHIRE - Medium PA for 100 |
GXWPE | Watchout Production Equipment | TEMP0101542 | 12-07-01 | 12-09-30 | 1 | TEMP CLIENT | Olympic Cinema |
GXWDC | Watchout Display Channels | TEMP0101542 | 12-07-01 | 12-09-30 | 3 | TEMP CLIENT | Olympic Cinema |
MACPRO | Apple MacPro / Playback Pro | ALB00010 | 12-07-05 | 12-07-08 | 1 | Productions | July 2012 Event - Video |
MACPRO | Apple MacPro / Playback Pro | ALB00010 | 12-07-05 | 12-07-08 | 1 | Productions | July 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]