Wow great idea. I did the query in access and then open the SQL view and
here is the string. 

SELECT tblNews.NewsDate, tblNews.Headline, tblNews.News, tblNews.Signature

FROM tblNews

WHERE (((tblNews.NewsDate) Between #1/10/2005# And #2/10/2005#));




Now all I need is to replace the between dates with 2 variables that are the
strCurrentDate amd strDate30DaysAgo and it should work. That is the last
part to figure out.

strCurrentDate = Date
strDate30DaysAgo = Date - 30 // is this right?


DOES THIS LOOK CORRECT?
SELECT tblNews.NewsDate, tblNews.Headline, tblNews.News, tblNews.Signature

FROM tblNews

WHERE (((tblNews.NewsDate) Between & "#" & '"strDate30DaysAgo"' & "#" And
"#" $ '"strCurrentDate"' % "#" & ));





 

-----Original Message-----
From: Peter Brunone [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 11, 2005 1:47 PM
To: [email protected]
Subject: RE: [AspNetAnyQuestionIsOk] strSQLstring = "SELECT * FROM tblNews
WHERE Newsdate = between date30daysago and datenow ORDER by NewsDate DESC"

 

 

 

 

   I haven't checked into this, but have you tried the Help docs in Access?

 

 

 From: "Mike Belcher" [EMAIL PROTECTED]

 

 

WHERE (Newsdate > DATEADD(d, - 8, { fn NOW() })) AND (StartDate < '" & 

Format(Now(),"d") & "')

 

 

Okay wow I will give that a try. Wow that looks complex. I haven't learned

much about the date functions. I guess I should find a place to read up on

it. 

 

 

-----Original Message-----

From: BobFilipiak [mailto:[EMAIL PROTECTED] 

 

 

Try:

WHERE (Newsdate > DATEADD(d, - 8, { fn NOW() })) AND (StartDate < '" & 

Format(Now(),"d") & "')

 

 

Bob Filipiak

A question not asked

is a lost opportunity to learn.

----- Original Message ----- 

From: "Mike Belcher" 

 

 

> 

 

> 

 

> I have a news database that when displayed I want to list the articles 

> from

> the current date to 30 days ago. How can this be done with a SQL String...

> 

 

> 

 

> strSQLstring = "SELECT * FROM tblNews WHERE Newsdate = between 

> date30daysago

> and date now ORDER by NewsDate DESC"

> 

 

> that is what I am trying to accomplish..........

> 

 

> 

 

> Mike Belcher

 

 

[Non-text portions of this message have been removed]

 

 

 

 

Yahoo! Groups Links

 

    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

 

    [EMAIL PROTECTED]

 

    http://docs.yahoo.com/info/terms/

 

 

 

 



[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to