Is your codebehind in C#? Try placing the NewEffDate for example, in a
DateTime variable dt, like so:
DateTime dt = NewEffDate;
string strDate = dt.ToString("MM/dd/yyyy");
Console.Out.WriteLine("The value is {0}", strDate);
Benj
On Apr 21, 1:37 am, Mac222 <[email protected]>
wrote:
> I am fairly new to ASP.NET, but have been using classic ASP for quick
> awhile. I am in the process of building a new website for our company
> using ASP.NET. I am using data extracted from a Microsoft Access
> database and have been successful in retrieving the data in question.
> However, I ran across one small problem. My current code reads:
>
> <%#IIf(Eval("EffDate") <= Container.DataItem("NewEffDate"), _
> Container.DataItem("NewEffDate"), Container.DataItem
> ("EffDate"))%>
>
> The only problem is the 'NewEffDate' and 'EffDate' are both displaying
> the date and time (9/22/2008 12:00:00 AM). The entry in the database
> (ShortDate format) only shows the date.
>
> My problem: How do I suppress the time? I've tried string.format
> ("NewEffDate", {0:d}"), but I get an 'Overload resolution" failed
> message.
>
> Thanks in advance for any assistance I can get.