|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
VBScript - Database - General - Joining Queries on Multiple Strings
I asked before about reporting on joing table etc and that worked well, however I am trying to get an output from joining the following tables;
tblstats tblnetminder tblfixtures I need to call all the data from the three tables based on the following; tblfixtures.fixdate=tblstats.statsdate=tblnetminde r.netdate=12/09/2009 AND tblstats.statsactive= -1 I have tried many ways but it doesnt always work. The query string I had was trying to call via gamestats.asp?statsdate=13/09/2009&netdate=13/09/2009 any help? |
|
#2
|
||||
|
||||
|
Maybe something like
Code:
select tblstats.*, tblnetminder.*, tblfixtures.* from tblstats inner join tblnetminder on tblstats.statsdate=tblnetminder.netdate inner join tblfixtures on tblstats.statsdate = tblfixtures.fixdate where tblstats.statsdate =12/09/2009 AND tblstats.statsactive= -1
__________________
Fremen United! Folding@Home team ID 169647. All Fremen welcome. |
|
#3
|
|||
|
|||
|
Quote:
If you are using an Access database then you need to surround your date with #s. If you are using SQL Server, then a single quote (') is needed. I don't know what the other versions do. |
|
#4
|
|||
|
|||
|
I had to alter the code to cover my table mistakes however I get the following error;
(** If i take out the dates it list all the fields **) Microsoft JET Database Engine error '80040e07' Data type mismatch in criteria expression. Code:
"select tblstats.*, tblnetminders.*, tblfixtures.* from ((tblstats inner join tblnetminders on tblstats.statsdate=tblnetminders.netdate) inner join tblfixtures on tblstats.statsdate = tblfixtures.fixturedate) where tblstats.statsdate ='20/09/2009' AND tblstats.statsactive= -1 " Last edited by lewis94 : November 4th, 2009 at 02:14 PM. |
|
#5
|
||||
|
||||
|
Quote:
Generally, that error comes about because you think a field is a number type in the database and it's actually text or vice versa. I would make sure that that all the fields are the datatype you think they are and make sure you are calling them correctly (not referring to a number as a string, etc). |
|
#6
|
|||
|
|||
|
Ive got it working now it was one of the common fields not matching, however it has a problem with a few date fields it swaps to USA format and doesnt show. Ive tried a session.lcid but it still doesnt work. The dates in the MS Access database are UK format and Ive retyped them
|
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > VBScript - Database - General - Joining Queries on Multiple Strings |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|