.NETGURU
ordering by date
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-oledb' list.


Srini
Hi all,
I am working on a WebForum using VB.Net & Access2K. I want to give the user an option to select to view messages posted in the last 7 / 15 Days.

Can any one tell me how can I do it? I have the following query, but this will return me only if a particular date is selected
SELECT [UserName], [Subject], MessageDesc, [DateCreated], [MessageViews]
FROM tblMessages
WHERE DateCreated=[@Date];

TYA
Regards
Srini
Reply to this message...
 
    
Peter Brunone
Srini,

Try

WHERE DateCreated BETWEEN ([@Date1], [@Date2])

or it might be BETWEEN [@Date1] AND [@Date2] ; it's been a while since I've
done that in Access.

Did you also want to know how to order by date, as the subject implies?
That would be accomplished by a simple

ORDER BY DateCreated

with ASC (ascending) as the default, and you could add DESC (descending) if
you wish.

Cheers,

Peter
-----Original Message-----
From: Srini [mailto:Click here to reveal e-mail address]
Sent: Sunday, May 05, 2002 10:22 AM
To: ngfx-oledb
Subject: [ngfx-oledb] ordering by date

Hi all,
I am working on a WebForum using VB.Net & Access2K. I want to give the
user an option to select to view messages posted in the last 7 / 15 Days.

Can any one tell me how can I do it? I have the following query, but this
will return me only if a particular date is selected
SELECT [UserName], [Subject], MessageDesc, [DateCreated], [MessageViews]
FROM tblMessages
WHERE DateCreated=[@Date];

TYA
Regards
Srini
| [ngfx-oledb] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/ngfx-oledb.asp = JOIN/QUIT
Reply to this message...
 
    
Srini
Hi Peter,
What I am actually tryign to accomplish s something like, if the user Selects 7 days from a drop down list than the messages to be obtained would be for the last 7 days from today. SO soemthign like @DaySelected=Date()-@daysselected

Is that possible?

Regards
Srini
----- Original Message -----
From: Peter Brunone
To: ngfx-oledb
Sent: Monday, May 06, 2002 8:22 PM
Subject: [ngfx-oledb] RE: ordering by date

Srini,

Try

WHERE DateCreated BETWEEN ([@Date1], [@Date2])

or it might be BETWEEN [@Date1] AND [@Date2] ; it's been a while since I've done that in Access.

Did you also want to know how to order by date, as the subject implies? That would be accomplished by a simple

ORDER BY DateCreated

with ASC (ascending) as the default, and you could add DESC (descending) if you wish.

Cheers,

Peter
-----Original Message-----
From: Srini [mailto:Click here to reveal e-mail address]
Sent: Sunday, May 05, 2002 10:22 AM
To: ngfx-oledb
Subject: [ngfx-oledb] ordering by date

Hi all,
I am working on a WebForum using VB.Net & Access2K. I want to give the user an option to select to view messages posted in the last 7 / 15 Days.

Can any one tell me how can I do it? I have the following query, but this will return me only if a particular date is selected
SELECT [UserName], [Subject], MessageDesc, [DateCreated], [MessageViews]
FROM tblMessages
WHERE DateCreated=[@Date];

TYA
Regards
Srini
| [ngfx-oledb] member Click here to reveal e-mail address = YOUR ID | http://www.aspfriends.com/aspfriends/ngfx-oledb.asp = JOIN/QUIT
| [ngfx-oledb] member Click here to reveal e-mail address = YOUR ID | http://www.aspfriends.com/aspfriends/ngfx-oledb.asp = JOIN/QUIT
Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification