Viewing 15 posts - 1 through 15 (of 28 total)
Thanks michael,yeah your right this one is more simple. And thanks to everyone.
declare @cmd varchar(200)
select @cmd =
'bcp "##LogWithNightShift" out E:\' +
replace(convert(varchar(10),getdate()-1,101),'/','')+
...
June 30, 2010 at 6:24 pm
Thanks for the answer. I'll take note of that.
Morris
June 29, 2010 at 12:37 am
Thanks wayne for the suggestion, Im just wondering, Because when I use your solution, I did not declare variable for Date. Is there a difference in performance on doing that?...
June 28, 2010 at 6:05 pm
At last I did it!, but If anyone see improvements on this script, please do tell me.
DECLARE @fn varchar(8000)
SELECT @fn = CASE
WHEN LEN(DatePart(mm,DateAdd(d,-1,DateAdd(d, DateDiff(d, 0, GetDate()), 0))))=1 THEN 'E:\'+ '0'...
June 28, 2010 at 3:23 am
DECLARE @fn varchar(8000)
SELECT @fn = 'E:\'+ CAST(DatePart(mm,DateAdd(d,-1,DateAdd(d, DateDiff(d, 0, GetDate()), 0))) AS varchar) + CAST(DatePart(dd,DateAdd(d,-1,DateAdd(d, DateDiff(d, 0, GetDate()), 0))) AS varchar) + CAST(DatePart(yyyy,DateAdd(d,-1,DateAdd(d, DateDiff(d, 0, GetDate()), 0))) AS varchar)...
June 28, 2010 at 12:09 am
sorry for that... I have to get yesterday date.
Thanks
Morris
June 27, 2010 at 9:19 pm
Thanks for the reply, Im using it in Cmd Prompt. (As .bat file)
June 27, 2010 at 9:06 pm
Thanks guys! I think it's too much if I ask again what are the meaning of the items that you inserted. I'll just study them by my self and maybe...
June 27, 2010 at 6:30 pm
Sorry for the misunderstanding, What I mean is that the table has 2million records on it. I only need to query or get a specific data on that 2milllion records....
June 25, 2010 at 2:54 am
Thanks for the respond, I really appreciate your advice, I will follow all of your advice.
Thanks again
Morris
June 24, 2010 at 10:23 pm
It's perfectly working, thanks!, honestly im having a hard time doing things in columns like this.
Thank you again!
June 24, 2010 at 5:53 pm
Thank you very much! It's 100% solved my problem. I tried to figure it out by myself by using union all but I'm not succesful. Your code was perfect. Thank...
May 8, 2010 at 1:08 am
This is the real data that I used.
CREATE TABLE [dbo].[tblData] (
[LogID] [int] IDENTITY (1, 1) NOT NULL ,
[EmpID] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[EmpName] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Dept]...
May 7, 2010 at 6:53 pm
Thank you for reply.., This will be the desired output.
CREATE TABLE [dbo].[tblESDData] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[Dept] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Daily] [int] NULL ,
[Weekly] [int]...
May 7, 2010 at 4:45 am
Thank you for your reply, sorry for not acknowledging his codes , yes your right it's much faster compare to my codes, but still my problem is that how will...
May 6, 2010 at 11:36 pm
Viewing 15 posts - 1 through 15 (of 28 total)