473,396 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

My SQL-string is the devil !

Hello there i have made a SQL-string thats the devil him self.

Here is the working one, here its take the value "Tim" from same table wich is "kostnader" but i want to take the "Tim" value from another table.

Working code
Expand|Select|Wrap|Line Numbers
  1. SQL = "SELECT projekt.projekt, projekt.id, projekt.lock, (SELECT COUNT(ID) FROM kostnader WHERE kostnader.personal_id = "& session("id") &" AND kostnader.projekt_id = projekt.id)  AS antal, (SELECT SUM(varde) FROM kostnader WHERE kostnader.projekt_id = projekt.id AND kostnader.personal_id = "& session("id") &" AND kostnader.enhettim = 'Tim') AS antaltim FROM projekt "
  2.  
And here is what iam trying to do, its just the end thats different in this string.
Instead of kostnader.enhettim = 'Tim' i have this to get the value from another table priskategori.enhet = 'Tim'

The table priskategori and colum enhet dose exist so dont get this-.

The error iam haveing is this.

* No value given for one or more required parameters.
Sep 17 '07 #1
3 1243
Sorry for this dubble post but in other forum the response is quick, but i guess that the most of the members are asleep. Iam living in sweden so the clock is not the same i guess.,
Sep 17 '07 #2
Anyone knows why i get this error, nothing in the database is wrong anyway :D
Sep 17 '07 #3
jhardman
3,406 Expert 2GB
Hello there i have made a SQL-string thats the devil him self.

Here is the working one, here its take the value "Tim" from same table wich is "kostnader" but i want to take the "Tim" value from another table.

Working code
Expand|Select|Wrap|Line Numbers
  1. SQL = "SELECT projekt.projekt, projekt.id, projekt.lock, (SELECT COUNT(ID) FROM kostnader WHERE kostnader.personal_id = "& session("id") &" AND kostnader.projekt_id = projekt.id)  AS antal, (SELECT SUM(varde) FROM kostnader WHERE kostnader.projekt_id = projekt.id AND kostnader.personal_id = "& session("id") &" AND kostnader.enhettim = 'Tim') AS antaltim FROM projekt "
  2.  
And here is what iam trying to do, its just the end thats different in this string.
Instead of kostnader.enhettim = 'Tim' i have this to get the value from another table priskategori.enhet = 'Tim'

The table priskategori and colum enhet dose exist so dont get this-.

The error iam haveing is this.

* No value given for one or more required parameters.
Sorry, it took me a minute to understand you. It's not that your english is really bad, it's that you use a more complicated query than I use. I always try to keep my sql very basic and I put my complex codes in the ASP script.

First off, how is the table "priskategori" related to the other tables? (for example I can tell that the relationship between "kostnader" and "projekt" is that "kostnader.projekt_id = projekt.id")

Jared
Sep 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Peter | last post by:
I run most of my SQL scripts via kornshell on AIX. I use the "here-document" to run some of the smaller ones. Example: #!/bin/ksh # Analyze the table. sqlplus...
10
by: Dagwood | last post by:
Good morning: At least it's morning where I am. :) I have a rather newbie question I'm afraid. I have VisualStudio.NET, and have installed it along with SQL server. However I can't seem to...
2
by: Yves Touze | last post by:
Hi All, I'm trying to migrate from SQL Server 7.0 to SQL Server 2000. I've got some ASP page which call VB components that retrieve shaped recordsets from SQL Server using the MSDATASHAPE...
9
by: Grim Reaper | last post by:
My work let me put SQL Server 7.0 Enterprise Edition on my laptop. I have never setup a server from the beginning, so I am a little new at creating server groups. Alright, I am trying to create...
13
by: Jeager | last post by:
Why is it, Microsoft manage to write operating systems and office applications with every bell and whistle facility known to man. Yet, even after years and years of development they still cannot...
11
by: Mark Yudkin | last post by:
The documentation is unclear (at least to me) on the permissibility of accessing DB2 (8.1.5) concurrently on and from Windows 2000 / XP / 2003, with separate transactions scope, from separate...
4
by: coosa | last post by:
Hi, I was installing SQL Server on my machine and during installation my PC freezed. It happens frequently on my machine. So i tried after restarting to install it again and since then i always...
1
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005...
14
by: Developer | last post by:
Hello All, i have recently installed VS2005 and was trying to install SQL sever 2000. I have Win XP' SP2. But when I tried installing, it only installed client tools and not the database. Can...
5
by: dbrother | last post by:
Access 2003 Win XP Pro SP3 Using SQL /ADO Recordsets in a Do Loop Hello, I'm using a random number generator based on an integer input from a user from a form that will get X number of random...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.