Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: date plus 7 days


Message #1 by Jean Halstad <J_Halstad@S...> on Tue, 12 Feb 2002 15:24:23 -0000
I want to query a database along the lines:



select * from tablename where startDate between ' "&strStartDate&" ' and '

"&strStartDate&" ' plus 7 days.



How do I add 7 days to the strStartDate variable?



***************************************************************************

This e-mail and any files transmitted with it are confidential and intended

solely for the use of the individual or entity to whom they are addressed

If you have received this e-mail in error please notify

seafish@s...



If the content is not about the business of the Sea Fish Industry Authority

or the sea fish industry then the message is neither from nor sanctioned

by the Sea Fish Industry Authority.

Message #2 by "O'Hara, Elliott M" <EMOHARA@k...> on Tue, 12 Feb 2002 10:37:54 -0500
dateadd("d",7,cDate(strStartDate))



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

From: Jean Halstad [mailto:J_Halstad@S...]

Sent: Tuesday, February 12, 2002 10:24 AM

To: ASP Web HowTo

Subject: [asp_web_howto] date plus 7 days





I want to query a database along the lines:



select * from tablename where startDate between ' "&strStartDate&" ' and '

"&strStartDate&" ' plus 7 days.



How do I add 7 days to the strStartDate variable?



***************************************************************************

This e-mail and any files transmitted with it are confidential and intended

solely for the use of the individual or entity to whom they are addressed

If you have received this e-mail in error please notify

seafish@s...



If the content is not about the business of the Sea Fish Industry Authority

or the sea fish industry then the message is neither from nor sanctioned

by the Sea Fish Industry Authority.






$subst('Email.Unsub').

Message #3 by Oleg Kapeljushnik <c-oleg.kapeljushnik@w...> on Tue, 12 Feb 2002 10:45:10 -0500
Try

Now() + 7.



Oleg



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

From: Jean Halstad [mailto:J_Halstad@S...]

Sent: February 12, 2002 10:24 AM

To: ASP Web HowTo

Subject: [asp_web_howto] date plus 7 days





I want to query a database along the lines:



select * from tablename where startDate between ' "&strStartDate&" ' and '

"&strStartDate&" ' plus 7 days.



How do I add 7 days to the strStartDate variable?



***************************************************************************

This e-mail and any files transmitted with it are confidential and intended

solely for the use of the individual or entity to whom they are addressed

If you have received this e-mail in error please notify

seafish@s...



If the content is not about the business of the Sea Fish Industry Authority

or the sea fish industry then the message is neither from nor sanctioned

by the Sea Fish Industry Authority.






$subst('Email.Unsub').



Message #4 by Fernando Farfan <FFarfan@b...> on Tue, 12 Feb 2002 09:59:44 -0600
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C1B3DE.4A0556A0

Content-Type: text/plain



You may use dateadd(datepart, number, date)

where datepart is  yy, mm, dd, etc...



So, what you want is

select * from tablename where startDate between '" & strStartDate & "' and

dateadd(dd, 7, '" & strStartDate & "')





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

From: Jean Halstad [mailto:J_Halstad@S...] 

Sent: Martes, 12 de Febrero de 2002 09:24 AM

To: ASP Web HowTo

Subject: [asp_web_howto] date plus 7 days





I want to query a database along the lines:



select * from tablename where startDate between ' "&strStartDate&" ' and '

"&strStartDate&" ' plus 7 days.



How do I add 7 days to the strStartDate variable?



***************************************************************************

This e-mail and any files transmitted with it are confidential and intended

solely for the use of the individual or entity to whom they are addressed If

you have received this e-mail in error please notify seafish@s...



If the content is not about the business of the Sea Fish Industry Authority

or the sea fish industry then the message is neither from nor sanctioned by

the Sea Fish Industry Authority.






$subst('Email.Unsub').




Message #5 by "Debreceni, David" <Debreceni.David@h...> on Tue, 12 Feb 2002 11:55:57 -0500
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C1B3E6.23FF2BE0

Content-Type: text/plain;

	charset="iso-8859-1"



the datepart of the dateadd(datepart, number, date)  can have these values,

and must be in quotes like Elliot's earlier example

dateadd("d",7,cDate(strStartDate))



datepart values:

	yyyy = Year

	q = Quarter

	m = Month

	y = Day of year

	d = Day

	w = Weekday

	ww = Week

	h = Hour

	n = Minute

	s = Second





hope that helps ya.





David Debreceni

Senior Visual Basic/ASP Developer

xxx-xxx-xxxx  x 1086

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

From: Fernando Farfan [mailto:FFarfan@b...]

Sent: Tuesday, February 12, 2002 11:00 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: date plus 7 days





You may use dateadd(datepart, number, date) 

where datepart is  yy, mm, dd, etc... 

So, what you want is 

select * from tablename where startDate between '" & strStartDate & "' and

dateadd(dd, 7, '" & strStartDate & "') 





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

From: Jean Halstad [mailto:J_Halstad@S...] 

Sent: Martes, 12 de Febrero de 2002 09:24 AM 

To: ASP Web HowTo 

Subject: [asp_web_howto] date plus 7 days 





I want to query a database along the lines: 

select * from tablename where startDate between ' "&strStartDate&" ' and '

"&strStartDate&" ' plus 7 days. 

How do I add 7 days to the strStartDate variable? 

*************************************************************************** 

This e-mail and any files transmitted with it are confidential and intended

solely for the use of the individual or entity to whom they are addressed If

you have received this e-mail in error please notify seafish@s...

If the content is not about the business of the Sea Fish Industry Authority

or the sea fish industry then the message is neither from nor sanctioned by

the Sea Fish Industry Authority.

--- 



$subst('Email.Unsub'). 




$subst('Email.Unsub'). 




Message #6 by "Drew, Ron" <RDrew@B...> on Tue, 12 Feb 2002 16:20:19 -0500
SQL Server

"select * from tablename where startDate between "&strStartDate&" and

DATEADD(day,7,"&strStartDate&")"

Access

"select * from tablename where startDate between #"&strStartDate&"# and

#"&strStartDate&"#+7"





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

From: Jean Halstad [mailto:J_Halstad@S...]

Sent: Tuesday, February 12, 2002 10:24 AM

To: ASP Web HowTo

Subject: [asp_web_howto] date plus 7 days





I want to query a database along the lines:



select * from tablename where startDate between ' "&strStartDate&" ' and

' "&strStartDate&" ' plus 7 days.



How do I add 7 days to the strStartDate variable?



************************************************************************

***

This e-mail and any files transmitted with it are confidential and

intended solely for the use of the individual or entity to whom they are

addressed If you have received this e-mail in error please notify

seafish@s...



If the content is not about the business of the Sea Fish Industry

Authority or the sea fish industry then the message is neither from nor

sanctioned by the Sea Fish Industry Authority.






$subst('Email.Unsub').

Message #7 by Jean Halstad <J_Halstad@S...> on Wed, 13 Feb 2002 14:40:54 -0000
Works like a charm. thanks for that.



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

From: O'Hara, Elliott M [mailto:EMOHARA@k...] 

Sent: 12 February 2002 15:38

To: ASP Web HowTo

Subject: [asp_web_howto] RE: date plus 7 days





dateadd("d",7,cDate(strStartDate))



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

From: Jean Halstad [mailto:J_Halstad@S...]

Sent: Tuesday, February 12, 2002 10:24 AM

To: ASP Web HowTo

Subject: [asp_web_howto] date plus 7 days





I want to query a database along the lines:



select * from tablename where startDate between ' "&strStartDate&" ' and '

"&strStartDate&" ' plus 7 days.



How do I add 7 days to the strStartDate variable?



***************************************************************************

This e-mail and any files transmitted with it are confidential and intended

solely for the use of the individual or entity to whom they are addressed

If you have received this e-mail in error please notify

seafish@s...



If the content is not about the business of the Sea Fish Industry Authority

or the sea fish industry then the message is neither from nor sanctioned

by the Sea Fish Industry Authority.






$subst('Email.Unsub').






$subst('Email.Unsub').



***************************************************************************

This e-mail and any files transmitted with it are confidential and intended

solely for the use of the individual or entity to whom they are addressed

If you have received this e-mail in error please notify

seafish@s...



If the content is not about the business of the Sea Fish Industry Authority

or the sea fish industry then the message is neither from nor sanctioned

by the Sea Fish Industry Authority.


  Return to Index