SQL
Detail
SELECT EV802_DESC, EV802_BKG_START_DATE, EV802_BKG_START_TIME, EV802_BKG_END_DATE, EV802_BKG_END_TIME,
ISNULL(CAST(CAST(ER101_RES_QTY AS MONEY)AS VARCHAR(20)),'') AS [QTY], ISNULL(CAST(CAST(ER101_UNIT_CHRG AS MONEY) AS VARCHAR(20)),'') AS [RATE],
ISNULL(CAST(CAST(ER101_EXT_CHRG AS MONEY) AS VARCHAR(20)),'') [SUBTOTAL], EV130_STATUS_DESC
FROM EV802_SPACE_BKD
INNER JOIN EV130_STATUS_MASTER
ON EV130_STATUS_CODE = EV802_BKG_STATUS
LEFT OUTER JOIN ER101_ACCT_ORDER_DTL ON ER101_ORG_CODE = EV802_ORG_CODE
AND ER101_EVT_ID = EV802_EVT_ID
AND ER101_SSB_NBR = EV802_SSB_NBR
AND ER101_PHASE = '1'
WHERE EV802_ORG_CODE = @ORGANIZATION
AND EV802_EVT_ID = @EVENT
ORDER BY EV802_BKG_START_DATE, EV802_BKG_START_TIME, EV802_SSB_NBR
Footer
SELECT CAST(CAST(SUM(ISNULL(ER101_UNIT_CHRG,0)) AS MONEY) AS VARCHAR(20)) AS [TOTAL]
FROM EV802_SPACE_BKD
INNER JOIN EV130_STATUS_MASTER
ON EV130_STATUS_CODE = EV802_BKG_STATUS
LEFT OUTER JOIN ER101_ACCT_ORDER_DTL
ON ER101_ORG_CODE = EV802_ORG_CODE
AND ER101_EVT_ID = EV802_EVT_ID
AND ER101_SSB_NBR = EV802_SSB_NBR
AND ER101_PHASE = '1'
WHERE EV802_ORG_CODE = @ORGANIZATION
AND EV802_EVT_ID = @EVENT
HTML
Header
<DIV><FONT size=2 face=Tahoma>
<TABLE style="FONT-FAMILY: Tahoma; FONT-SIZE: x-small" border=1 cellSpacing=0 cols=8>
<TBODY>
<TR>
<TD style="WORD-WRAP: break-word" id=0 width=100 align=left><B>Space</B></TD>
<TD style="WORD-WRAP: break-word" id=1 width=100 align=middle><B>Start Date</B></TD>
<TD style="WORD-WRAP: break-word" id=2 width=100 align=middle><B>Start Time</B></TD>
<TD style="WORD-WRAP: break-word" id=3 width=100 align=middle><B>End Date</B></TD>
<TD style="WORD-WRAP: break-word" id=4 width=100 align=middle><B>End Time</B></TD>
<TD style="WORD-WRAP: break-word" id=5 width=100 align=right><B>Qty</B></TD>
<TD style="WORD-WRAP: break-word" id=6 width=100 align=right><B>Rate</B></TD>
<TD style="WORD-WRAP: break-word" id=7 width=100 align=right><B>Total</B></TD>
</TR>
</TBODY>
</TABLE>
</FONT>
</DIV>
Detail
<DIV><FONT size=2 face=Tahoma>
<TABLE style="FONT-FAMILY: Tahoma; FONT-SIZE: x-small" border=1 cellSpacing=0 cols=8>
<TBODY>
<TR>
<TD style="WORD-WRAP: break-word" id=0 width=100 align=left>*EV802_DESC</TD>
<TD style="WORD-WRAP: break-word" id=1 width=100 align=middle>*EV802_BKG_START_DATE</TD>
<TD style="WORD-WRAP: break-word" id=2 width=100 align=middle>*EV802_BKG_START_TIME</TD>
<TD style="WORD-WRAP: break-word" id=3 width=100 align=middle>*EV802_BKG_END_DATE</TD>
<TD style="WORD-WRAP: break-word" id=4 width=100 align=middle>*EV802_BKG_END_TIME</TD>
<TD style="WORD-WRAP: break-word" id=5 width=100 align=right>*QTY</TD>
<TD style="WORD-WRAP: break-word" id=6 width=100 align=right>*RATE</TD>
<TD style="WORD-WRAP: break-word" id=7 width=100 align=right>*SUBTOTAL</TD>
</TR>
</TBODY>
</TABLE>
</FONT>
</DIV>
Footer
<DIV><FONT size=2 face=Tahoma>
<TABLE style="FONT-FAMILY: Tahoma; FONT-SIZE: x-small" border=1 cellSpacing=0 cols=8>
<TBODY>
<TR>
<TD style="WORD-WRAP: break-word" id=0 width=100 align=left></TD>
<TD style="WORD-WRAP: break-word" id=1 width=100 align=middle></TD>
<TD style="WORD-WRAP: break-word" id=2 width=100 align=middle></TD>
<TD style="WORD-WRAP: break-word" id=3 width=100 align=middle></TD>
<TD style="WORD-WRAP: break-word" id=4 width=100 align=middle></TD>
<TD style="WORD-WRAP: break-word" id=5 width=100 align=right></TD>
<TD style="WORD-WRAP: break-word" id=6 width=100 align=right><B>Total</B></TD>
<TD style="WORD-WRAP: break-word" id=7 width=100 align=right><B>*TOTAL</B></TD>
</TR>
</TBODY>
</TABLE>
</FONT>
</DIV>
*Content contributed by Tickett Enterprises Limited
Comments
3 comments
I'm using similar data to pull the booking table into a proposal. However, when using EV802_DESC, the system is stripping out the "&" symbol. Anyway to prevent this?
Thanks,
Brooke
0 upvotes
Try replacing EV802_DESC with REPLACE(EV802_DESC, '&', '&')
1 upvotes
Thanks Lee! This worked great!
0 upvotes
Please sign in to leave a comment.