472,136 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,136 software developers and data experts.

SQL Date Woes...Please Help

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!
Jul 19 '05 #1
2 1677
> 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.)

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #2

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.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Raven | last post: by
6 posts views Thread by Gerry Viator | last post: by
reply views Thread by Rob | last post: by
6 posts views Thread by Dr Ann Huxtable | last post: by
3 posts views Thread by Kevin Vaughn | last post: by
5 posts views Thread by Kevin | last post: by
MonolithTMA
3 posts views Thread by MonolithTMA | last post: by
4 posts views Thread by =?Utf-8?B?VkIgSm9ubmll?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.