Click here to Skip to main content
15,907,687 members
Home / Discussions / Database
   

Database

 
GeneralRe: SqlParameter was expected, but it's been given! Pin
Ed.Poore21-Oct-06 7:55
Ed.Poore21-Oct-06 7:55 
QuestionHow to fill null data in control froms in VB.Net Pin
rehan_cop19-Oct-06 7:09
rehan_cop19-Oct-06 7:09 
AnswerRe: How to fill null data in control froms in VB.Net Pin
Mairaaj Khan19-Oct-06 22:34
professionalMairaaj Khan19-Oct-06 22:34 
Questionselecting data for crystal reports Pin
haseeb_saeed18-Oct-06 21:14
haseeb_saeed18-Oct-06 21:14 
Questioncatching sql exception type Pin
DownBySpj18-Oct-06 21:01
DownBySpj18-Oct-06 21:01 
AnswerRe: catching sql exception type Pin
Colin Angus Mackay19-Oct-06 5:18
Colin Angus Mackay19-Oct-06 5:18 
AnswerRe: SQL error :Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.??? [help] Pin
Mike Dimmick19-Oct-06 6:51
Mike Dimmick19-Oct-06 6:51 
Questionhow to display daily sales between the date? [urgent] Pin
campbells18-Oct-06 18:58
campbells18-Oct-06 18:58 
I have create a SQL which calculate the daily sale but it will only show 1 day when i run it
<br />
<br />
select t1.supermarket,t1.softline, t1.hardline, (t1.supermarket+t1.softline+ t1.hardline)as TOTAL <br />
from (select (select sum(totalsales+returnamt)as TotalSoft from tot_item <br />
where bizdate='2006-10-1'and (deptcode= 11 or deptcode=12 or <br />
deptcode=13 or deptcode=14 or deptcode= 15 or deptcode= 16 or deptcode= 17  ))as softline,<br />
<br />
(select sum (totalsales+returnamt)as TotalHard from tot_item <br />
where bizdate='2006-10-1'and (deptcode= 21 or deptcode=22 or deptcode=23 or deptcode=<br />
24 or deptcode= 25 or deptcode=26 or deptcode= 27 or deptcode= 28 or deptcode= 29 ) )as hardline,<br />
<br />
(select sum(totalsales+returnamt)as TotalSupermarket from tot_item <br />
where bizdate='2006-10-1' and (deptcode= 30 or deptcode=40 or deptcode=50 or deptcode=<br />
60 or deptcode= 70 or deptcode=80 or deptcode= 90)) as supermarket <br />
 )as t1 <br />
<br />


but i want to show like the daily result between day 1- day 15 so i create this SQL but the result not wat i expected, the RESULT should the TOTAL sum of this 15 days.... i want to show 1 by 1 for the daily sale... how?

select t1.supermarket,t1.softline, t1.hardline, (t1.supermarket+t1.softline+ t1.hardline)as TOTAL <br />
from (select (select sum(totalsales+returnamt)as sototal from tot_item <br />
where bizdate<='2006-10-15' and bizdate>='2006-10-01'and (deptcode= 11 or deptcode=12 or <br />
deptcode=13 or deptcode=14 or deptcode= 15 or deptcode= 16 or deptcode= 17 ))as softline,<br />
<br />
(select sum(totalsales+returnamt)as htotal from tot_item <br />
where bizdate<='2006-10-15' and bizdate>='2006-10-01'and (deptcode= 21 or deptcode=22 or deptcode=23 or deptcode=<br />
24 or deptcode= 25 or deptcode=26 or deptcode= 27 or deptcode= 28 or deptcode= 29 ) )as hardline,<br />
<br />
(select sum(totalsales+returnamt)as sutotal from tot_item <br />
where bizdate<='2006-10-15' and bizdate>='2006-10-01'and (deptcode= 30 or deptcode=40 or deptcode=50 or <br />
deptcode=60 or deptcode= 70 or deptcode=80 or deptcode= 90 )) as supermarket <br />
 )as t1 <br />

AnswerRe: how to display daily sales between the date? [urgent] Pin
Edbert P19-Oct-06 15:25
Edbert P19-Oct-06 15:25 
GeneralRe: how to display daily sales between the date? [urgent] Pin
campbells19-Oct-06 15:49
campbells19-Oct-06 15:49 
GeneralRe: how to display daily sales between the date? [urgent] Pin
Edbert P19-Oct-06 16:02
Edbert P19-Oct-06 16:02 
GeneralRe: how to display daily sales between the date? [urgent] Pin
Edbert P19-Oct-06 16:04
Edbert P19-Oct-06 16:04 
GeneralRe: how to display daily sales between the date? [urgent] Pin
campbells19-Oct-06 16:37
campbells19-Oct-06 16:37 
Questionsqlconnection Pin
avahia18-Oct-06 17:53
avahia18-Oct-06 17:53 
QuestionError I keep getting in my vb program (ADO error) Pin
MichaelDurham18-Oct-06 10:21
MichaelDurham18-Oct-06 10:21 
AnswerRe: Error I keep getting in my vb program (ADO error) Pin
Edbert P19-Oct-06 18:41
Edbert P19-Oct-06 18:41 
GeneralRe: Error I keep getting in my vb program (ADO error) Pin
MichaelDurham24-Oct-06 8:24
MichaelDurham24-Oct-06 8:24 
QuestionSlow performance in .NET? Pin
Xiangyang Liu 刘向阳18-Oct-06 4:10
Xiangyang Liu 刘向阳18-Oct-06 4:10 
AnswerRe: Slow performance in .NET? Pin
Ed.Poore19-Oct-06 13:36
Ed.Poore19-Oct-06 13:36 
GeneralRe: Slow performance in .NET? Pin
Xiangyang Liu 刘向阳20-Oct-06 17:26
Xiangyang Liu 刘向阳20-Oct-06 17:26 
GeneralRe: Slow performance in .NET? Pin
Ed.Poore21-Oct-06 8:04
Ed.Poore21-Oct-06 8:04 
QuestionHow to increase size of database in SQL Server 2000 Pin
prakash_21017-Oct-06 23:24
prakash_21017-Oct-06 23:24 
AnswerRe: How to increase size of database in SQL Server 2000 Pin
Mairaaj Khan18-Oct-06 0:12
professionalMairaaj Khan18-Oct-06 0:12 
GeneralRe: How to increase size of database in SQL Server 2000 Pin
Jerry Hammond18-Oct-06 10:09
Jerry Hammond18-Oct-06 10:09 
QuestionUsing dataset in a client-server application Pin
baxter_dev17-Oct-06 23:11
baxter_dev17-Oct-06 23:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.