Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

In INSERT command how do i insert one dynamic value.

3 posts in General Discussion Last posting was on 2004-02-25 05:21:41.0Z
Chandresh Patel Posted on 2004-02-24 21:56:55.0Z
From: "Chandresh Patel" <bapashree@yahoo.com>
Newsgroups: ianywhere.public.general
Subject: In INSERT command how do i insert one dynamic value.
Lines: 28
Organization: Shreeji Smart Solution
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: aca8b22b.ipt.aol.com
X-Original-NNTP-Posting-Host: aca8b22b.ipt.aol.com
Message-ID: <403bc8a7$1@forums-1-dub>
Date: 24 Feb 2004 13:56:55 -0800
X-Trace: forums-1-dub 1077659815 172.168.178.43 (24 Feb 2004 13:56:55 -0800)
X-Original-Trace: 24 Feb 2004 13:56:55 -0800, aca8b22b.ipt.aol.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2623
Article PK: 6096

Hi,

I am using Sybase Anywhere 9.0.0.1108

In my procedure I declare one temprary table and store some data like this.

DECLARE LOCAL TEMPORARY TABLE
CompData
(DisplayDate Varchar(30), NetSales FLOAT, TotalTax FLOAT, CustomerCount
INTEGER);

Insert data in this table this way:

Insert INTO CompData (NetSales, TotalTax, CustomerCount) select
(sum(A.DunkinSales)) - (sum(A.Overring) + sum(A.salesTax)) as NetSales,
sum(A.SalesTax) as SalesTax, sum(A.CustomerCount) as CustomerCount from
Sales A, DayActivity B where A.DayActivityID = B.DayActivityID and
B.StoreID=mStoreID and CAST(DayDate AS DATE) BETWEEN StartDate and EndDate;

But I want to insert DisplayDate value also and this is StartDate and
EndDate string.

How can i insert this value with select command.

Thanks in Advance.


Reg Domaratzki Posted on 2004-02-25 05:10:14.0Z
From: "Reg Domaratzki" <nospam.please@sympatico.ca>
Newsgroups: ianywhere.public.general
References: <403bc8a7$1@forums-1-dub>
Subject: Re: In INSERT command how do i insert one dynamic value.
Lines: 49
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: kitchener-hse-ppp3567531.sympatico.ca
X-Original-NNTP-Posting-Host: kitchener-hse-ppp3567531.sympatico.ca
Message-ID: <403c2e36$1@forums-1-dub>
Date: 24 Feb 2004 21:10:14 -0800
X-Trace: forums-1-dub 1077685814 65.93.111.110 (24 Feb 2004 21:10:14 -0800)
X-Original-Trace: 24 Feb 2004 21:10:14 -0800, kitchener-hse-ppp3567531.sympatico.ca
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2627
Article PK: 6099

Insert INTO CompData (DisplayDate, NetSales, TotalTax, CustomerCount)
select
STRING ( DATEFORMAT ( StartDate, 'Mm/Dd/yyyy' ), ' To ', DATEFORMAT (
EndDate, 'Mm/Dd/yyyy' ) ),
(sum(A.DunkinSales)) - (sum(A.Overring) + sum(A.salesTax)) as NetSales,
sum(A.SalesTax) as SalesTax,
sum(A.CustomerCount) as CustomerCount
from Sales A, DayActivity B
where A.DayActivityID = B.DayActivityID
and B.StoreID=mStoreID
and CAST(DayDate AS DATE) BETWEEN StartDate and EndDate;

--
Reg

"Chandresh Patel" <bapashree@yahoo.com> wrote in message
news:403bc8a7$1@forums-1-dub...
> Hi,
>
> I am using Sybase Anywhere 9.0.0.1108
>
> In my procedure I declare one temprary table and store some data like
this.
>
> DECLARE LOCAL TEMPORARY TABLE
> CompData
> (DisplayDate Varchar(30), NetSales FLOAT, TotalTax FLOAT, CustomerCount
> INTEGER);
>
> Insert data in this table this way:
>
> Insert INTO CompData (NetSales, TotalTax, CustomerCount) select
> (sum(A.DunkinSales)) - (sum(A.Overring) + sum(A.salesTax)) as NetSales,
> sum(A.SalesTax) as SalesTax, sum(A.CustomerCount) as CustomerCount from
> Sales A, DayActivity B where A.DayActivityID = B.DayActivityID and
> B.StoreID=mStoreID and CAST(DayDate AS DATE) BETWEEN StartDate and
EndDate;
>
> But I want to insert DisplayDate value also and this is StartDate and
> EndDate string.
>
> How can i insert this value with select command.
>
> Thanks in Advance.
>
>
>


Chandresh Patel Posted on 2004-02-25 05:21:41.0Z
From: "Chandresh Patel" <bapashree@yahoo.com>
Newsgroups: ianywhere.public.general
References: <403bc8a7$1@forums-1-dub> <403c2e36$1@forums-1-dub>
Subject: Re: In INSERT command how do i insert one dynamic value.
Lines: 60
Organization: Shreeji Smart Solution
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-Original-NNTP-Posting-Host: ac8285a6.ipt.aol.com
Message-ID: <403c30f2@forums-2-dub>
X-Original-Trace: 24 Feb 2004 21:21:54 -0800, ac8285a6.ipt.aol.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 24 Feb 2004 21:21:06 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 24 Feb 2004 21:21:41 -0800
X-Trace: forums-1-dub 1077686501 10.22.108.75 (24 Feb 2004 21:21:41 -0800)
X-Original-Trace: 24 Feb 2004 21:21:41 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2629
Article PK: 6102

Wow, Perfact

It works. Thank you very much.

"Reg Domaratzki" <nospam.please@sympatico.ca> wrote in message
news:403c2e36$1@forums-1-dub...
> Insert INTO CompData (DisplayDate, NetSales, TotalTax, CustomerCount)
> select
> STRING ( DATEFORMAT ( StartDate, 'Mm/Dd/yyyy' ), ' To ', DATEFORMAT (
> EndDate, 'Mm/Dd/yyyy' ) ),
> (sum(A.DunkinSales)) - (sum(A.Overring) + sum(A.salesTax)) as NetSales,
> sum(A.SalesTax) as SalesTax,
> sum(A.CustomerCount) as CustomerCount
> from Sales A, DayActivity B
> where A.DayActivityID = B.DayActivityID
> and B.StoreID=mStoreID
> and CAST(DayDate AS DATE) BETWEEN StartDate and EndDate;
>
> --
> Reg
>
> "Chandresh Patel" <bapashree@yahoo.com> wrote in message
> news:403bc8a7$1@forums-1-dub...
> > Hi,
> >
> > I am using Sybase Anywhere 9.0.0.1108
> >
> > In my procedure I declare one temprary table and store some data like
> this.
> >
> > DECLARE LOCAL TEMPORARY TABLE
> > CompData
> > (DisplayDate Varchar(30), NetSales FLOAT, TotalTax FLOAT, CustomerCount
> > INTEGER);
> >
> > Insert data in this table this way:
> >
> > Insert INTO CompData (NetSales, TotalTax, CustomerCount) select
> > (sum(A.DunkinSales)) - (sum(A.Overring) + sum(A.salesTax)) as NetSales,
> > sum(A.SalesTax) as SalesTax, sum(A.CustomerCount) as CustomerCount from
> > Sales A, DayActivity B where A.DayActivityID = B.DayActivityID and
> > B.StoreID=mStoreID and CAST(DayDate AS DATE) BETWEEN StartDate and
> EndDate;
> >
> > But I want to insert DisplayDate value also and this is StartDate and
> > EndDate string.
> >
> > How can i insert this value with select command.
> >
> > Thanks in Advance.
> >
> >
> >
>
>