"Select *, SUBSTRING((SELECT ',' + s.product FROM DiscountedWarrantiesOffersProducts s where idoffer=d.id ORDER BY s.product FOR XML PATH('')),2,200000) as products from DiscountedWarrantiesOffers d"
This is the query from I am getting the Data on Gridview.
I want to sort the fields in that gridview.
One field is Text datatype.
Kindly suggest the query.
Akash
Nilesh ShahPosted May 23, 2017, 11:18 AM
Akash SalunkhePosted May 23, 2017, 11:59 AM
Nilesh ShahPosted May 23, 2017, 11:51 AM
Akash SalunkhePosted May 23, 2017, 11:30 AM
strSql = "Select *, CONVERT(nvarchar, offerdescription) AS OfferDescription1 from FinanceOffers"
Else
strSql = "Select * from FinanceOffers"
End If
If sortExpression = "" Then
strSql &= " order by offerid "
Else
If sortExpression = "offerdescription" Then
sortExpression = "offerdescription1"
End If
strSql &= " order by " & sortExpression
If sortDirection = 1 Then
strSql &= " DESC "
Else
strSql &= " ASC "
End If