SQL Date Woes...Please Help

K

kmeds

I am creating a news script in ASP 3.0 with SQL 2000 backend. I'm new
to SQL (I used to use Access exclusively... :( )

In any case I have a database of the News set up like this"
NewsIDNum int ident
NewsTitle char
NewsDate smalldate
NewsText Text

When I'm writing to the page I'm putting
<%=(rsNews.Fields.Item("NewsDate").Value)%>

This is yielding nothing. I am going to be writing a series of news
stories to each page and each should display the date it was written.

Dummy Check:

- I checked the db to be sure the field had date data in it
- I made sure nothing was misspelled
- I read aspfaq.com but didn't see my answer there in terms I
understood it seemed more useful for if you were using 1 date on a
page or not pulling the date from the database.

Any help would be greatly appreciated.

Thank you!
 
A

Aaron Bertrand - MVP

When I'm writing to the page I'm putting
<%=(rsNews.Fields.Item("NewsDate").Value)%>

This is yielding nothing.

What is the query that populates rsNews? Showing more code is usually
better than showing less code (though there is a limit; if your ASP page is
8,000 lines, please don't post it all, just the relevant parts).

Also, what does the following yield?

<%=rsNews("NewsDate")%>

Are you sure the query returns any records at all? Are you using an .EOF
check, or on error resume next? (Again, this shows how more code would be
useful.)
 
K

kmeds

Actually a co-worker and I figured out my problem after I posted this.

Essentially I was trying to use the CONVERT function in the code of my
page at the point where I was writing from the database to the actual
HTML page. I needed to do it within my Select Statement.

ASPFAQ saves the day again with all the great codes for the conversion!

Thanks for the super resource and quick response.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top