A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

problem with query in ASP using date()



 
 
Thread Tools Display Modes
  #1  
Old December 17th, 2009, 07:30 AM posted to microsoft.public.access.queries
sravanthi
external usenet poster
 
Posts: 1
Default problem with query in ASP using date()

Hi.
Hi, I am novice to ASP,I am using vb script and MSacceess for database.When
ever I use the following code it gives the error.I am sure the problem is
with entry_datetime='#"data"#' but not sure how to resolve it.It would be
great if some one helps me in resolving the following query. .

%

data=date()

dim rs1,sql1

Set rs1 = Server.CreateObject("Adodb.RecordSet")

sql1="select * from web where format(entry_datetime,'"mm/dd/yyyy hh:min:ss"')
=format('#"data"#','"mm/dd/yyyy hh:min:ss"') and stace = 'oregon' "

rs1.open sql1,conn,1,1

%

  #2  
Old December 17th, 2009, 12:53 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default problem with query in ASP using date()

sql1="SELECT* from web WHERE Format(entry_datetime,""mm/dd/yyyy hh:nn:ss"")
=Format(data,""mm/dd/yyyy hh:nn:ss"") and stace = 'oregon' "

I am concerned that Format is being used since I am not aware of whether or
not you can use FORMAT directly with Jet.


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

sravanthi wrote:
Hi.
Hi, I am novice to ASP,I am using vb script and MSacceess for database.When
ever I use the following code it gives the error.I am sure the problem is
with entry_datetime='#"data"#' but not sure how to resolve it.It would be
great if some one helps me in resolving the following query. .

%

data=date()

dim rs1,sql1

Set rs1 = Server.CreateObject("Adodb.RecordSet")

sql1="select * from web where format(entry_datetime,'"mm/dd/yyyy hh:min:ss"')
=format('#"data"#','"mm/dd/yyyy hh:min:ss"') and stace = 'oregon' "

rs1.open sql1,conn,1,1

%

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:04 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.