You can run it comma separated and save the results to a CSV file. Go into Tools->Options and in the Results tab select Comma Separated from the Results Output Format drop down.
Dan.
I just tried doing that, and I couldn't change the global address book. This will only work with items in your Contacts folder, or any user created address books.
Dan.
Try doing the following. Create a local variable of the datetime type and populate with your value, then you will be able to convert to American date format.
declare @dt as datetime
select @dt = '24-Jan-04'
select convert(char(20), @dt, 101)
Dan.
Create a new column and enter the following formula in the first cell and drag down your entire column:
=TEXT(A1,"mm/dd")
Cell A1 should oviously be replaced with the actual cell that contains your complete date. You should now be able to sort by the actual mon/day.
Dan.
Here is another way I have done it using the Bulk Insert command:
BULK INSERT TableName
FROM 'c:\FileName.txt'
WITH (
FIELDTERMINATOR = '\t',
ROWTERMINATOR = '\n'
)
GO
I did this using a tab delimited text file. The rowterminator value '\n' is a newline feed.
Dan.
One thing that worked for me in the past is to create a linked server to the Excel file:
exec sp_addlinkedserver
@server= 'ExcelSource',
@provider= 'Microsoft.Jet.OLEDB.4.0',
@srvproduct= 'Jet 4.0',
@datasrc= 'c:\FileName.xls'
go
{enter your input code here}
go
exec sp_dropserver @server=...
The thing about UNION queries is that all queries being UNIONed need to have the same output columns with the same data types. For example, if query1 has Name, Age, Salary query 2 needs to have Name, Age, Salary.
Dan.
There is no standard function for this. You can create your own and attach it to your worksheet. Should be pretty simple:
Function ShtName()
ShtName = ActiveSheet.Name
End Function
Dan.
Try using the following:
select replace(convert(char(10), getdate(), 121), '-', '')
CONVERT is changing the date to the format yyyy-mm-dd hh:mi:ss.mmm(24h), and only returning the first 10 characters. REPLACE is removing the '-' only leaving you with the format you are looking for.
Dan.
Do you have a date field that shows the datetime the record was updated? Do you have a record number that could show the order the records were created? Is there something in the note column value that could be used to show incrementation (did I just make this word up)? If no to all of these...
This is my last idea. Try giving your table an alias:
SELECT *
FROM OPENQUERY(LinkedServer, 'SELECT * from LinkedServer.test.dbo.Table1 t
where t.name=''test''' )
Dan.
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.