borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (CreateParameter ad? for SQL TEXT)Next Topic (INSERT INTO statement : MySQL) New Topic New Poll Post Reply
AndreaVB Forum : Database : URGENT!!! select date1 until date2 and more field Help Please...
Poster Message
joanleonz
Level: Trainee

Registered: 08-06-2006
Posts: 1

icon URGENT!!! select date1 until date2 and more field Help Please...

i have created a mysql with table dss
but i`m confused about this
this is the table of dss

-------------------------------------------------------
date | drivers | Group | SPeed |
-------------------------------------------------------
01/01/2006 2111 north 64
02/01/2006 2121 north 53
03/01/2006 2145 north 43
04/01/2006 2187 south 77
05/01/2006 2133 north 35
06/01/2006 2165 south 38
07/01/2006 2181 north 38
08/01/2006 2135 north 42
09/01/2006 2111 north 43
10/01/2006 2124 south 41
11/01/2006 2113 north 45
12/01/2006 2109 north 75
13/01/2006 2106 north 75
14/01/2006 2111 north 75
15/01/2006 2123 south 90
--------------------------------------------------------

then i want select the date from 01/01/2006 until 10/01/2006 with
the driver is 2111 with group north and with speed from 24 until 90

i made date with dtpicker and drivers,group and speed with textbox
please help me what kind of code what must i have

i has been made some sql statement

mstrSQL = "SELECT * from dss WHERE (Date>= #" &
DTdate1.value & "#) AND (Date<= #" & DTdate2.value & "#)"
AND driver='" & txtdriver.text & "'" AND group='" & txtgroup.text & "'"
AND (speed >='" & txtspeed1.text & "'") AND (speed <='" & txtspeed1.text & "'")

but still not show
please help me? URGENT!


thanks

08-06-2006 at 03:46 PM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 891
icon Re: URGENT!!! select date1 until date2 and more field Help Please...

Hi,
Question: Why are you using >= txtspeed1 AND <= txtspeed1? this looks like 24 to 24 from your example.

I'm not familiar with mysql, but maybe instead of "#date#" using "'12 feb 2006'" would be better?
Kieron


[Edited by stickleprojects on 08-06-2006 at 11:16 PM GMT]

____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

08-06-2006 at 11:15 PM
View Profile Send Email to User Show All Posts | Quote Reply
VYX
Level: Professor


Registered: 16-12-2005
Posts: 70
icon Re: URGENT!!! select date1 until date2 and more field Help Please...

Hello...

No vb installed on my computer now but  try this code ....

mstrSQL = "SELECT * from dss WHERE (Date between #" &
DTdate1.value & "# AND  #" & DTdate2.value & "#)"
AND driver='" & txtdriver.text & "'" AND group='" & txtgroup.text & "'"
AND (speed >='" & txtspeed1.text & "'") AND (speed <='" & txtspeed1.text & "'")





Hope it helps

__________
vyx

09-06-2006 at 09:16 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : URGENT!!! select date1 until date2 and more field Help Please...
Previous Topic (CreateParameter ad? for SQL TEXT)Next Topic (INSERT INTO statement : MySQL) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder