Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with a 'where date' clause in ASP VBSCRIPT...
Message
De
05/03/2001 18:23:15
Peter Brama
West Pointe Enterprises
Detroit, Michigan, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Titre:
Problem with a 'where date' clause in ASP VBSCRIPT...
Divers
Thread ID:
00482024
Message ID:
00482024
Vues:
209
I am using VFP for the database on a website that uses VBSCRIPT for its coding. I have a field in my
table that is type DATE. I want to find all records that are greater than today. I tried the following
commands as follows:

mySQL= (see examples below)
response.write mySQL
set eventSet=DBmiym.Execute(mySQL)

Here is what I tried

#1 FIRST TRY
mySQL="select * from event where sdate >= " & date()
#1 RETURNS:
select * from event where sdate >= 3/5/2001
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC Visual FoxPro Driver]Operator/operand type mismatch.

#2 ADDED POUND SIGNS
mySQL="select * from event where sdate >= #" & date() & "#"
#2 RETURNS:
select * from event where sdate >= #3/5/2001#
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Visual FoxPro Driver]Missing operand.

#3 HARD CODED DATE:
mySQL="select * from event where sdate >=#03/01/2001#"
#3 RETURNS:
select * from event where sdate >= #03/05/2001#
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Visual FoxPro Driver]Missing operand.

#4 HARD CODED WITHOUT POUND
mySQL="select * from event where sdate >= 03/05/2001"
#4 RETURNS:
select * from event where sdate >= 03/05/2001
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC Visual FoxPro Driver]Operator/operand type mismatch.

#5 WORKS, BUT DOESN'T SOLVE PROBLEM
mySQL="select * from event where sdate >= date()"


I believe # 5 works because it uses a command inherent with a sql statement internally. But what happens
when I need to look for something other than today, a field that was entered will say on the a form. One
of these should work somehow, shouldn't it?
Peter Brama
West Pointe Enterprises

VFP is getting easier but STILL alot to learn!!
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform