Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Anessa
Starting Member
4 Posts |
Posted - 2005-09-08 : 12:23:30
|
| Hello,I need to edit my sql database query output so that if "day_start" = "day_end", only "day_start" would display. currently this code...<td><%= rs("ceMonth")%>/<%= rs("day_start")%>-<%= rs("day_end")%>/<%= rs("ceYear")%></td>Outputs this in the webpage...9/13-13/2005I need the output in such cases to display like this...9/13/2005Which brings me to another issue. How can I dynamically "remove" the "-" between the days only when "day_start" = "day_end"?Any assistance would be very much appreciated.Anessa |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-09-08 : 12:27:15
|
Its a Presentation Layer issue really (rathre than a SQL one). Try changing<%= rs("day_start")%>-<%= rs("day_end")%>/to<% if rs("day_start") = rs("day_end") then Response.Write rs("day_start") else Response.Write rs("day_start") & "-" & rs("day_end") End If%>Kristen |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-09-08 : 12:34:52
|
Brett: have you got a problem with this?12/31-1/2006I mean, surely you don't specify the YEAR when you give an estimated date to get something done? Kristen |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
Anessa
Starting Member
4 Posts |
Posted - 2005-09-08 : 15:37:38
|
| Thanks Kristen! It works perfectly!Anessa |
 |
|
|
|
|
|