473,386 Members | 1,734 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,386 software developers and data experts.

sql command error

2
Respected Sir,

I run once sql querry in sql 2000 but show error. pls give me soluction now.

SELECT a.BILL_DATE,
COUNT (DISTINCT a.bill_number + ' ' + a.bill_date + ' ' + a.till_number) nob,
SUM (a.net_amt) bill_value
FROM bill_detail b, bill_header a
WHERE b.bill_date='10-feb-08'
AND a.bill_date = b.bill_date
AND a.bill_number = b.bill_number
AND a.till_number = b.till_number
AND a.bill_status = 'B'
--AND b.net_amt > 199
GROUP BY a.bill_date

show error--------------------

Server: Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to numeric.
Feb 11 '08 #1
3 1389
debasisdas
8,127 Expert 4TB
The error message is self explanatory.
Feb 11 '08 #2
avi25b
2
SELECT TO_CHAR (&start_date, 'DD MON')
|| ' TO '
|| TO_CHAR (&end_date, 'DD MON YY') AS BILL_DATE,
COUNT (DISTINCT a.bill_number || a.bill_date || a.till_number) nob,
SUM (a.net_amt) bill_value
FROM bill_detail a, bill_header b
WHERE b.bill_date BETWEEN &START_DATE AND &END_DATE
AND a.bill_date = b.bill_date
AND a.bill_number = b.bill_number
AND a.till_number = b.till_number
AND b.bill_status = 'B'
--AND b.net_amt > 199
GROUP BY b.bill_date

HOW RUN ABOVE QUERRY IN SQL SERVER 2000
Feb 12 '08 #3
deepuv04
227 Expert 100+
SELECT TO_CHAR (&start_date, 'DD MON')
|| ' TO '
|| TO_CHAR (&end_date, 'DD MON YY') AS BILL_DATE,
COUNT (DISTINCT a.bill_number || a.bill_date || a.till_number) nob,
SUM (a.net_amt) bill_value
FROM bill_detail a, bill_header b
WHERE b.bill_date BETWEEN &START_DATE AND &END_DATE
AND a.bill_date = b.bill_date
AND a.bill_number = b.bill_number
AND a.till_number = b.till_number
AND b.bill_status = 'B'
--AND b.net_amt > 199
GROUP BY b.bill_date

HOW RUN ABOVE QUERRY IN SQL SERVER 2000
try the following query

SELECT convert(varchar(15),@start_date, 106)
+ ' TO '
+ convert(varchar(15),@end_date, 106) AS BILL_DATE,
COUNT (DISTINCT a.bill_number || a.bill_date || a.till_number) nob,
SUM (a.net_amt) bill_value
FROM bill_detail a, bill_header b
WHERE b.bill_date BETWEEN @start_date AND @end_date
AND a.bill_date = b.bill_date
AND a.bill_number = b.bill_number
AND a.till_number = b.till_number
AND b.bill_status = 'B'
--AND b.net_amt > 199
GROUP BY b.bill_date

thnks
Feb 12 '08 #4

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

Similar topics

4
by: Laura P | last post by:
Hi, I wasn't sure whether this should be posted in the Java are or in a Solaris thread, so I shall post it in both. Sorry for the duplication. I am new to Solaris and am having trouble...
4
by: MLH | last post by:
I am having failures processing the following command and I wonder if you can tell me what I must do in order to have success. When I try to run source mysql_dump.sql.txt ==> it is a problem...
12
by: Rhino | last post by:
I am having an odd problem: the sqlj command on my system doesn't work. I am running DB2 (LUW) V8 (FP8) on WinXP. I haven't done an sqlj program since Version 6 of DB2 (LUW) so I checked the...
2
by: Chris Bolus | last post by:
I'm a teacher using MS Access on an RMConnect 2.4 network. On some workstations both I and my students sometimes get an error message when attempting to insert a command button on a form which...
2
by: SunRise | last post by:
Hi I am creating a C Program , to extract only-Printable-characters from a file ( any type of file) and display them. OS: Windows-XP Ple help me to fix the Errors & Warnings and explain...
0
by: Andre Azevedo | last post by:
Hi all ! I've created a .net serviced component with only one method. This method receive an ADODB.Command object and execute it. The ADODB.Command object is created in the client process. (VB...
5
by: Genboy | last post by:
My "VIS" Website, which is a C# site created in VS.NET, Framework 1.1, is no longer compiling for me via the command line. As I have done 600 times in the last year and a half, I can compile to...
34
by: Roman Mashak | last post by:
Hello, All! I'm implementing simple CLI (flat model, no tree-style menu etc.). Command line looks like this: <command> <param1> <param2> ... <paramN> (where N=1..4) And idea is pretty simple: ...
10
by: jimmy | last post by:
Hi again, sorry for posting two questions so close together but im working on a school project which is due in soon and running into some difficulties implementing the database parts. I have the...
2
by: Taras_96 | last post by:
Hi everyone, I'm trying to run a number of commands stored within a sql file from within php using mysqli::query. The syntax I'm using is: source C:\data\projects\forum...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.