Thanks a lot for everyone's help.
Terri, I was trying to understand your 3 codes, especially the first one. Could you tell me shortly what these codes do to help me understand?
1. Select @dt=
dateadd(wk,@week-1,'1/1/'+ltrim(str(year(getdate()))))
why @week-1, and ltrim and str function...
Thanks Terry and Sunil, I appreciate your help.
I tried the codes and they worked great, but now I don't know which variable for me to change for the week number. What I wanted to do is if I enter a integer (1-53) as a week number then after execute the statements, they will return a date range...
The sql statement below return a week number (10)
select datename(week, '03/12/02') as number
Now is it possible to do the opposite, like I have a week number 10 then the statement(s) would return a date range from 03/03/02 to 03/09/02. Appreciate your helps.
Thanks cmmrfrds.
I have been trying to do a sp-addlinkedserver but did not seem to work.
What I am trying to do it's to link CAT server to DOG server.
CAT is SQL server 7.0 and DOG is SQL server 2000 (that has a different sysadmin id and password from CAT).Could you please show me how to link...
Thanks Chiph.
I tried your codes but did not work. Is it because I did not execute sp-addlinkedserver? Would it help if I run that?
Again thanks for your helps
Hello everyone.
I am trying to do a SELECT statement joining two tables from two different SQL Servers that have different authentication. Is it possible? Do I make any sense? Please help, THANKS
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.