Viewing 15 posts - 18,016 through 18,030 (of 18,926 total)
If you can't work it out, post your query and we'll help you.
April 27, 2005 at 9:30 am
This will need some tweaking but it can give you an idea :
SELECT [city_code], [outlet_code], sum([sold_units]) as UnitsSold, CAST(Issue - 1 AS INT) / 4 AS UnitPeriod
FROM [MerchDB].[dbo].[tblOutletSales]
where active...
April 27, 2005 at 9:29 am
Maybe this will help :
GO
create table #t
(
Col1 varchar(10) not null,
TS timestamp not null
)
GO
Insert into #t (Col1) values ('test')
Insert into #t (Col1) values ('test2')
Insert into #t (Col1) values ('test3')
Select *...
April 27, 2005 at 9:22 am
Why don't you add a column Period and another group by by this period?
April 27, 2005 at 9:15 am
We were simply suggesting the trigger solution because it would avoid doing this complexe condition twice in a row :
WHERE Len([Rec.code]) > 2 --Check Length
...
April 27, 2005 at 6:56 am
That's why 2 heads are always better than one
...
I'm not sure which solution would be better because they all seem pretty much the...
April 26, 2005 at 1:52 pm
Declare @a as decimal(18,4)
set @a = 12345.67
Select replace (@a, '.', '')
--123456700
please note that you'll always get 4 decimals even if it's an integer
April 26, 2005 at 1:49 pm
Or you could delete them right away from your staging table using the same where condition, but using a delete trigger to do the insert on the error table... That...
April 26, 2005 at 1:32 pm
Select DISTINCT R.clinicphone from dbo.records R left outer join dbo.center C on R.clinicphone = C.clinicphone where C.clinicphone is null
This will give you a list of clinicphones that exists in records...
April 26, 2005 at 11:36 am
Yes there's a way as Noeld pointed out but why do you want to format your data like this?? this work is more often than not supposed to be...
April 26, 2005 at 11:26 am
that means that the syntax is correct, try doing a left join from the child table to the parent table to find missing keys. Correct those (either by recreating the...
April 26, 2005 at 11:23 am
ALTER TABLE dbo.records ADD CONSTRAINT
FK_records_center_FKNAME FOREIGN KEY
(
clinicphone
) REFERENCES dbo.center
(
clinicphone
)
April 26, 2005 at 10:09 am
Viewing 15 posts - 18,016 through 18,030 (of 18,926 total)