Archive for November, 2007

Example of dateDiff

– requirement: get agreementVersionID where the transactiondate is within 30 days from the billingcoveragestartdate
– transactiondate = 30-06-2007 between 28-09-2007
select top 100 agreementversionid, billingcoveragestartdate, transactiondate from pansales..licensetransactionitem
where billingcoveragestartdate is not null
and transactiondate between ‘06-30-2007′ and ‘09-28-2007′
and datediff (d,transactiondate,billingcoveragestartdate)

Wednesday, November 14th, 2007

xp_fileexist

xp_fileexist ‘\\serverName\robdat\rob.finished’
Results:

File Exists
1

0 = file doesn’t exists
1 = file exists

Tuesday, November 13th, 2007

DOS command: Where

Found this interesting little command today. A co-worker & friend asked me how to find a file name on a remote server.
At first, it sounds pretty easy right, do a ‘dir \\servername\path\filename.’ Well … she doesn’t know the path.
Looked around and found the WHERE command … oooo. Syntax is as followed
where -r [...]

Wednesday, November 7th, 2007