D
DS
This SQL UNION works...until I place the order by statement in the mix. I
need the order by to sort Num-Alpha fields...Any help Appreciated.
Thaks
DS
With Me.ListAll
.RowSource = "SELECT tblChecksTMP.ChkTabID, tblChecksTMP.ChkAlias,
tblChecksTMP.CheckID, " & _
"tblChecksTMP.ChkTaxCodeID, tblChecksTMP.ChkGuests,
tblChecksTMP.ChkPaid, tblChecksTMP.ChkServer, " & _
"tblChecksTMP.ChkPrinted, tblChecksTMP.ChkDividedCheck,
tblChecksTMP.ChkTypeID, " & _
"tblChecksTMP.ChkCancelled, tblChecksTMP.ChkFXSep, " & _
"Val(tblChecksTMP.ChkAlias) AS TS, tblChecksTMP.ChkAlias " & _
"FROM tblChecksTMP " & _
"GROUP BY tblChecksTMP.ChkTabID, tblChecksTMP.ChkAlias,
tblChecksTMP.CheckID, tblChecksTMP.ChkTaxCodeID, " & _
"tblChecksTMP.ChkGuests, tblChecksTMP.ChkPaid,
tblChecksTMP.ChkServer, tblChecksTMP.ChkPrinted, " & _
"tblChecksTMP.ChkDividedCheck, tblChecksTMP.ChkTypeID,
tblChecksTMP.ChkCancelled, tblChecksTMP.ChkFXSep " & _
"HAVING tblChecksTMP.ChkDividedCheck=0 AND
tblChecksTMP.ChkCancelled=0 " & _
"UNION " & _
"SELECT tblChecks.ChkTabID, tblChecks.ChkAlias, tblChecks.CheckID, "
& _
"tblChecks.ChkTaxCodeID, tblChecks.ChkGuests, tblChecks.ChkPaid,
tblChecks.ChkServer, " & _
"tblChecks.ChkPrinted, tblChecks.ChkDividedCheck,
tblChecks.ChkTypeID, " & _
"tblChecks.ChkCancelled, tblChecks.ChkFXSep, " & _
"Val(tblChecks.ChkAlias) AS TS, tblChecks.ChkAlias " & _
"FROM tblChecks " & _
"GROUP BY tblChecks.ChkTabID, tblChecks.ChkAlias, tblChecks.CheckID,
tblChecks.ChkTaxCodeID, " & _
"tblChecks.ChkGuests, tblChecks.ChkPaid, tblChecks.ChkServer,
tblChecks.ChkPrinted, " & _
"tblChecks.ChkDividedCheck, tblChecks.ChkTypeID,
tblChecks.ChkCancelled, tblChecks.ChkFXSep " & _
"HAVING tblChecks.ChkDividedCheck=0 AND tblChecks.ChkCancelled=0 " &
_
"ORDER BY Val(tblChecks.ChkAlias), tblChecks.ChkAlias;"
.ColumnCount = 14
.ColumnWidths = "0 in;2 in;0 in;0 in;0 in;0 in;0 in;0 in;0 in;0 in;0
in;0 in;0 in;0 in"
.Requery
End With
need the order by to sort Num-Alpha fields...Any help Appreciated.
Thaks
DS
With Me.ListAll
.RowSource = "SELECT tblChecksTMP.ChkTabID, tblChecksTMP.ChkAlias,
tblChecksTMP.CheckID, " & _
"tblChecksTMP.ChkTaxCodeID, tblChecksTMP.ChkGuests,
tblChecksTMP.ChkPaid, tblChecksTMP.ChkServer, " & _
"tblChecksTMP.ChkPrinted, tblChecksTMP.ChkDividedCheck,
tblChecksTMP.ChkTypeID, " & _
"tblChecksTMP.ChkCancelled, tblChecksTMP.ChkFXSep, " & _
"Val(tblChecksTMP.ChkAlias) AS TS, tblChecksTMP.ChkAlias " & _
"FROM tblChecksTMP " & _
"GROUP BY tblChecksTMP.ChkTabID, tblChecksTMP.ChkAlias,
tblChecksTMP.CheckID, tblChecksTMP.ChkTaxCodeID, " & _
"tblChecksTMP.ChkGuests, tblChecksTMP.ChkPaid,
tblChecksTMP.ChkServer, tblChecksTMP.ChkPrinted, " & _
"tblChecksTMP.ChkDividedCheck, tblChecksTMP.ChkTypeID,
tblChecksTMP.ChkCancelled, tblChecksTMP.ChkFXSep " & _
"HAVING tblChecksTMP.ChkDividedCheck=0 AND
tblChecksTMP.ChkCancelled=0 " & _
"UNION " & _
"SELECT tblChecks.ChkTabID, tblChecks.ChkAlias, tblChecks.CheckID, "
& _
"tblChecks.ChkTaxCodeID, tblChecks.ChkGuests, tblChecks.ChkPaid,
tblChecks.ChkServer, " & _
"tblChecks.ChkPrinted, tblChecks.ChkDividedCheck,
tblChecks.ChkTypeID, " & _
"tblChecks.ChkCancelled, tblChecks.ChkFXSep, " & _
"Val(tblChecks.ChkAlias) AS TS, tblChecks.ChkAlias " & _
"FROM tblChecks " & _
"GROUP BY tblChecks.ChkTabID, tblChecks.ChkAlias, tblChecks.CheckID,
tblChecks.ChkTaxCodeID, " & _
"tblChecks.ChkGuests, tblChecks.ChkPaid, tblChecks.ChkServer,
tblChecks.ChkPrinted, " & _
"tblChecks.ChkDividedCheck, tblChecks.ChkTypeID,
tblChecks.ChkCancelled, tblChecks.ChkFXSep " & _
"HAVING tblChecks.ChkDividedCheck=0 AND tblChecks.ChkCancelled=0 " &
_
"ORDER BY Val(tblChecks.ChkAlias), tblChecks.ChkAlias;"
.ColumnCount = 14
.ColumnWidths = "0 in;2 in;0 in;0 in;0 in;0 in;0 in;0 in;0 in;0 in;0
in;0 in;0 in;0 in"
.Requery
End With