Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to specify date range for query (VFP9 OleDB)
Message
De
02/03/2006 18:05:17
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01099668
Message ID:
01101114
Vues:
12
It's been awhile since I've done anything with VFP, so I don't know if this is legit, but can you delimit with quotes instead of {}? If so, you'd have this instead:
   dim MySql as string = String.Format("select s.sdate1,s.sdate2,s.Location,c.cTitle,e.hours " & _
       "from dtrSess s join dtrEnroll e on e.scode=s.scode join dtrCourse c on c.ccode=s.ccode " & _
       "where e.id_code= {0} and between(s.sdate1,'{1}','{2}')", Request.Item("ID"),dRdate1,dRdate2)
~~Bonnie



>OK, I thought I was over the hump on this, but I'm still not getting it to run. This code gives me "Function name is missing )."
>
>
>   dim dRdate1   as DateTime = DateTime.Parse(Request.Item("d1"))
>   dim dRdate2   as DateTime = DateTime.Parse(Request.Item("d2"))
>
>   dim MySql as string = String.Format("select s.sdate1,s.sdate2,s.Location,c.cTitle,e.hours " & _
>       "from dtrSess s join dtrEnroll e on e.scode=s.scode join dtrCourse c on c.ccode=s.ccode " & _
>       "where e.id_code= {0} and between(s.sdate1,{1},{2})", Request.Item("ID"),dRdate1,dRdate2)
>
>
>If I display the contents of the MySql variable the where clause is
>
>where e.id_code= 1043 and between(s.sdate1,7/23/2003 12:00:00 AM,7/23/2003 12:00:00 AM)
>
>In order to run that in VFP I have to delimit the datetimes:
>
>between(s.sdate1, {7/23/2000 12:00:00 AM},{7/23/2005 12:00:00 AM})
>
>This works from the command window in VFP, but I haven't been able to figure out how to get this done in the VB script. I've tried various convoluted ways to concatenate the delimiters onto the date variables, but still coming up dry.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform