Data Manager Group By Column

List kvEntities = dataManager.loadValues(
"SELECT e.tradeDate, " +
"e.tiParticipantCsp.fullName, " +
"e.tiProduct.commShortName, " +
"MAX(e.tiPriceunitMyr) AS priceUnitMyr, " +
"MAX(e.tiUnit.unitName) AS unitName, " +
"SUM(e.tiOfferVal) AS totalOfferVal, " +
"SUM(e.tiOfferVol) AS totalOfferVol, " +
"SUM(e.tiMatchedVal) AS totalMatchedVal, " +
"SUM(e.tiMatchedVol) AS totalMatchedVol, " +
"SUM(e.tiDeliveryVal) AS totalDeliveryVal, " +
"SUM(e.tiDeliveryVol) AS totalDeliveryVol, " +
"SUM(e.tiWithdrawalVal) AS totalWithdrawalVal, " +
"SUM(e.tiWithdrawalVol) AS totalWithdrawalVol, " +
"SUM(e.tiInvenrotyVal) AS totalInventoryVal, " +
"SUM(e.tiInvenrotyVol) AS totalInventoryVol, " +
"SUM(e.tfpLocalMyr) AS totalTfpLocalMyr, " +
"SUM(e.tfpLocalUsd) AS totalTfpLocalUsd, " +
"SUM(e.tfpForeignUsd) AS totalTfpForeignUsd, " +
"SUM(e.tfpMyrEquivalent) AS totalTfpMyrEquivalent, " +
"SUM(e.hfpLocalMyr) AS totalHfpLocalMyr, " +
"SUM(e.hfpLocalUsd) AS totalHfpLocalUsd, " +
"SUM(e.hfpForeignUsd) AS totalHfpForeignUsd, " +
"SUM(e.hfpMyrEquivalent) AS totalHfpMyrEquivalent, " +
"SUM(e.ntfpLocalMyr) AS totalNtfpLocalMyr, " +
"SUM(e.ntfpLocalUsd) AS totalNtfpLocalUsd, " +
"SUM(e.ntfpForeignUsd) AS totalNtfpForeignUsd, " +
"SUM(e.ntfpMyrEquivalent) AS totalNtfpMyrEquivalent, " +
"MAX(e.locality) AS locality, " +
"e.tiSubAccountName.branchName " +
“FROM TTradingValueCspDetail e WHERE e.cancelStatus=’” + false + “’” + queryString + " GROUP BY " +
"e.tradeDate, " +
"e.tiProduct.commShortName, " +
"e.tiSubAccountName.branchName, " +
"e.tiParticipantCsp.fullName " +
“ORDER BY e.tradeDate DESC”
)
.store(“main”)
.properties(
“tradeDate”,
“tiParticipantCsp.fullName”,
“tiProduct.commShortName”,
“priceUnitMyr”,
“unitName”,
“totalOfferVal”,
“totalOfferVol”,
“totalMatchedVal”,
“totalMatchedVol”,
“totalDeliveryVal”,
“totalDeliveryVol”,
“totalWithdrawalVal”,
“totalWithdrawalVol”,
“totalInventoryVal”,
“totalInventoryVol”,
“totalTfpLocalMyr”,
“totalTfpLocalUsd”,
“totalTfpForeignUsd”,
“totalTfpMyrEquivalent”,
“totalHfpLocalMyr”,
“totalHfpLocalUsd”,
“totalHfpForeignUsd”,
“totalHfpMyrEquivalent”,
“totalNtfpLocalMyr”,
“totalNtfpLocalUsd”,
“totalNtfpForeignUsd”,
“totalNtfpMyrEquivalent”,
“locality”,
“tiSubAccountName.branchName”
)
.list();

I want to write a query using data manager load value to group by this one specific column which is datetime column. The question is, how do I group by that date column without time, just want to extract date only?

You can refer the code above, the column that I am trying to group by, one of them is “e.tradeDate” but it comes with time along. Please clear me up with one workaround to solve this.

Thank you, in advance.

Hello,

try with this
DATE(e.tradeDate)
this should remove the time part out.

Kind regards,
Mladen