Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datafld Bound control problem

Status
Not open for further replies.
Nov 8, 2005
25
CA
Hi there

I have a table on my asp page that is bound to SQL Server.

The table is like this

<tbody>
<tr>
<td><div id="column1" datafld="EmployeeID" </div></td>
<td><div id="column2" datafld="LastName" </div></td>
<td><div id="column3" datafld="FirstName" </div></td>
<td><div id="column4" datafld="LastModifiedDate" </div></td>
</tr>
</tbody>

When I return my data set from SQL Server (the SQL I issue is, obviously,

SELECT EmployeeID, LastName, FirstName, LastModifiedDate from tblEmployees

Unfortunately when I display the table, the fourth column gives me something like

2006-04-26 13:58:14.857000000

and ALL that I want is just the date component.

So my question is, is there something I can do in my ASP page that would trim the datafld to say the first 10 characters (yyyy-mm-dd takes up 10 characters)? Or must I add one more returning column in my SQL? I don't like changing the SQL just so that I can display something properly... I wish it were something I could fix on the asp client side.

Many thanks.
CalgaryChinese
 
><td><div id="column4" datafld="LastModifiedDate" </div></td>
Try think along this line.
[tt]<td><div id="column4" datafld="<%=left(rs("LastModifiedDate"),10)%>"[red]>[/red]</div></td>[/tt]
Why all <div not closed?
 
Hi tsuji


Thanks for your quick response!

1. first, the missing > is simply my typo. They are closed in my code.

2. what you quote... hmmmm my code does client-side processing, so even the database retrieval is done via the old client side RDS object... so your server-side won't work. I think I should've mentioned that in my original message.

Thanks
CC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top