ASP.NET in line string comparison -
i've inherited code displays list of calendar events start date , end date. values come sql db through stored procedure, making way onto aspx page.
if event starts , ends on same day don't want display end date. despite having visually compared data, attempt implement using inline snippet below has failed , continues show enddate:
<%# (eval("edate") == eval("sdate")) ? "blank" : "enddate" %>
any advice on i'm doing wrong? or how implement on stored procedure side? code generating there is:
sdate = case when str(day(startdate)) = 1 datename(mm, [startdate])+' '+ltrim(str(day(startdate)))+ 'st' + ', ' when str(day(startdate)) =2 datename(mm, [startdate])+ ' ' +ltrim(str(day(startdate))) + 'nd' + ', ' when str(day(startdate)) =3 datename(mm, [startdate])+ ' ' +ltrim(str(day(startdate))) + 'rd'+ ', ' when str(day(startdate)) =21 datename(mm, [startdate])+ ' ' + ltrim(str(day(startdate))) + 'st' + ', ' when str(day(startdate)) =22 datename(mm, [startdate])+ ' ' +ltrim(str(day(startdate))) + 'nd' + ', ' when str(day(startdate)) =23 datename(mm, [startdate])+ ' ' + ltrim(str(day(startdate)))+ 'rd'+ ', ' when str(day(startdate)) =31 datename(mm, [startdate])+ ' ' +ltrim(str(day(startdate))) + 'st' + ', ' else datename(mm, [startdate])+ ' ' +ltrim(str(day(startdate)))+ 'th'+ ', ' end, edate = case when str(day(enddate)) = 1 datename(mm, [enddate])+' '+ltrim(str(day(enddate)))+ 'st' + ', ' when str(day(enddate)) =2 datename(mm, [enddate])+ ' ' +ltrim(str(day(enddate))) + 'nd' + ', ' when str(day(enddate)) =3 datename(mm, [enddate])+ ' ' +ltrim(str(day(enddate))) + 'rd'+ ', ' when str(day(enddate)) =21 datename(mm, [enddate])+ ' ' + ltrim(str(day(enddate))) + 'st' + ', ' when str(day(enddate)) =22 datename(mm, [enddate])+ ' ' +ltrim(str(day(enddate))) + 'nd' + ', ' when str(day(enddate)) =23 datename(mm, [enddate])+ ' ' + ltrim(str(day(enddate)))+ 'rd'+ ', ' when str(day(enddate)) =31 datename(mm, [enddate])+ ' ' +ltrim(str(day(enddate))) + 'st' + ', ' else datename(mm, [enddate])+ ' ' +ltrim(str(day(enddate)))+ 'th'+ ', ' end
Comments
Post a Comment