ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 2nd, 2009, 03:43 PM
lewis94 lewis94 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 40 lewis94 User rank is Corporal (100 - 500 Reputation Level)lewis94 User rank is Corporal (100 - 500 Reputation Level)lewis94 User rank is Corporal (100 - 500 Reputation Level)lewis94 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 39 m 56 sec
Reputation Power: 3
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?

Reply With Quote
  #2  
Old November 2nd, 2009, 05:33 PM
bigmike1212's Avatar
bigmike1212 bigmike1212 is online now
Option Explicit, baby.
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2009
Location: Neighborhood of Make-Believe
Posts: 554 bigmike1212 User rank is First Lieutenant (10000 - 20000 Reputation Level)bigmike1212 User rank is First Lieutenant (10000 - 20000 Reputation Level)bigmike1212 User rank is First Lieutenant (10000 - 20000 Reputation Level)bigmike1212 User rank is First Lieutenant (10000 - 20000 Reputation Level)bigmike1212 User rank is First Lieutenant (10000 - 20000 Reputation Level)bigmike1212 User rank is First Lieutenant (10000 - 20000 Reputation Level)bigmike1212 User rank is First Lieutenant (10000 - 20000 Reputation Level)bigmike1212 User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 5 Days 17 h 58 m 5 sec
Reputation Power: 146
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 
You'll probably have to futz with the date format and wrap # #'s around it or something.
__________________
Fremen United! Folding@Home team ID 169647. All Fremen welcome.

Reply With Quote
  #3  
Old November 2nd, 2009, 05:56 PM
Krandor Krandor is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 154 Krandor User rank is Second Lieutenant (5000 - 10000 Reputation Level)Krandor User rank is Second Lieutenant (5000 - 10000 Reputation Level)Krandor User rank is Second Lieutenant (5000 - 10000 Reputation Level)Krandor User rank is Second Lieutenant (5000 - 10000 Reputation Level)Krandor User rank is Second Lieutenant (5000 - 10000 Reputation Level)Krandor User rank is Second Lieutenant (5000 - 10000 Reputation Level)Krandor User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 17 h 15 m 13 sec
Reputation Power: 71
Quote:
Originally Posted by bigmike1212
You'll probably have to futz with the date format and wrap # #'s around it or something.

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.

Reply With Quote
  #4  
Old November 4th, 2009, 02:10 PM
lewis94 lewis94 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 40 lewis94 User rank is Corporal (100 - 500 Reputation Level)lewis94 User rank is Corporal (100 - 500 Reputation Level)lewis94 User rank is Corporal (100 - 500 Reputation Level)lewis94 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 39 m 56 sec
Reputation Power: 3
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.

Reply With Quote
  #5  
Old November 4th, 2009, 03:00 PM
bigmike1212's Avatar
bigmike1212 bigmike1212 is online now
Option Explicit, baby.
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2009
Location: Neighborhood of Make-Believe
Posts: 554 bigmike1212 User rank is First Lieutenant (10000 - 20000 Reputation Level)bigmike1212 User rank is First Lieutenant (10000 - 20000 Reputation Level)bigmike1212 User rank is First Lieutenant (10000 - 20000 Reputation Level)bigmike1212 User rank is First Lieutenant (10000 - 20000 Reputation Level)bigmike1212 User rank is First Lieutenant (10000 - 20000 Reputation Level)bigmike1212 User rank is First Lieutenant (10000 - 20000 Reputation Level)bigmike1212 User rank is First Lieutenant (10000 - 20000 Reputation Level)bigmike1212 User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 5 Days 17 h 58 m 5 sec
Reputation Power: 146
Quote:
Originally Posted by lewis94
Data type mismatch in criteria expression.


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).

Reply With Quote
  #6  
Old November 4th, 2009, 03:43 PM
lewis94 lewis94 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2008
Posts: 40 lewis94 User rank is Corporal (100 - 500 Reputation Level)lewis94 User rank is Corporal (100 - 500 Reputation Level)lewis94 User rank is Corporal (100 - 500 Reputation Level)lewis94 User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 39 m 56 sec
Reputation Power: 3
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

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > VBScript - Database - General - Joining Queries on Multiple Strings


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek