Viewing 15 posts - 31 through 45 (of 52 total)
Hi Lynn & Jeff,
I made a mistake there is no traingular join. I don't quite remember why i mentioned it, I guess I was thinking about not...
June 29, 2009 at 12:00 am
Hi,
If ':Entity' is common among all the values then
select left(columnname,len(substring(columnname,1,charindex(':',extra)-1))) from tablename
please try this
create table #chk(colm varchar(30))
insert into #chk
select 'pp_uniline_usd:Entity' union all
select 'dfsdafsdfsdaf:Entity' union all
select...
June 26, 2009 at 6:50 am
Hi,
Is this what you need?
create table #BuildingJob(Bldg int,Job varchar(50))
insert into #BuildingJob
select 100, 'Plumber' UNION ALL
select 202, 'Plumber' UNION ALL
select 301, 'Plumber' UNION ALL
select 521, 'Security' UNION ALL
select 523, 'Security'...
June 24, 2009 at 6:00 am
Hi there,
I have tried to solve your problem using row_number() and pivot function.
create table #tblItems(ItemName char(1),Date datetime)
insert into #tblItems
select 'a','2008-01-01 00:00:00.000' UNION ALL
select 'a','2008-01-01 00:00:00.000' UNION ALL
select 'b','2008-01-01...
June 23, 2009 at 7:56 am
Hi,
I think I got it right by changing the query.
select IssueNoteID,StockCategoryID,QtyIssued,Left(GRNNo,len(GRNNo)-1)
from (
Select IssueNoteID,StockCategoryID,Sum(IssuedItemQty) as QtyIssued,( SELECT G.GRNNo + ','
...
June 23, 2009 at 12:54 am
Hi Adi,
Thanks for correction I wasn't sure about clustered index on primary keys though.
May be you can point what anomalies could arise if however...
June 16, 2009 at 7:39 am
hi there,
I would love to know why do you need two primary keys in your table.
Although i think in relational database a primary key...
June 16, 2009 at 7:13 am
Hi there,
I think you should try this and tell me if I have understood your problem right. I would appreciate a response
create table #tblItem( dt datetime, ItemID int)
insert into...
June 15, 2009 at 11:27 pm
Hi there,
I have tried to write a query for your problem with this sample table, tblPurchaseOrder - PurchaseOrderDate & GrandTotal
here it is-
select weekno,newdate,sum(grandtotal) as grandtotal...
June 9, 2009 at 12:58 am
Hi,
you might try this-
select ...(your query goes here)
except
select top 1 ..(your query goes here)
May 31, 2009 at 12:23 am
Hi Shantaram,
The given code logic i had posted earlier would work well for characters strings as well, if it is written in comma separated list.
As per the given code:
"
declare...
May 22, 2009 at 7:00 am
Hi Shantaram,
The given code logic i had posted earlier would work well for characters strings as well, if it is written in comma separated list.
As per the given code:
"
declare...
May 22, 2009 at 7:00 am
Hi shantaram,
You can use Tally table method as described in "Numbers or Tally Table"
article by Jeff Gordan on this site.There might also be other solutions by using loop.But for starters...
May 22, 2009 at 5:20 am
Hi there,
you can use replace function which has following syntax
-: replace(@stringvar,charactertoreplace,newcharacter)
for e.g.
DECLARE @HashText nvarchar(10)
set @HashText= '''1,2,3,4'''
declare @grate nvarchar(10)
set @grate=replace(@HashText,'''','')
select @grate
May 22, 2009 at 2:47 am
Hi,
you can try this
select EMP_CODE,DATE_OF_BIRTH ,DATEDIFF(DD,DATE_OF_BIRTH,getdate())/365 as years,(DATEDIFF(DD,DATE_OF_BIRTH,getdate())%365)/30 as months,
DATEDIFF(DD,DATE_OF_BIRTH,getdate())%365%30 as days
from EMP_MST where accountid=4
Hitendra
May 11, 2009 at 1:16 am
Viewing 15 posts - 31 through 45 (of 52 total)