Trancedified
Programmer
Hello,
I have a listbox w/ names of SQL Server 2000 fields loaded into it.
I looped through the listbox to include square brackets [ ] incase the fields have a blank.
Here is my code:
Is there a way to tell which field is a SQL Server datetime field automatically then grab that field and CONVERT it with:
(That cuts off the time in the field)
Thanks!
Chris
I have a listbox w/ names of SQL Server 2000 fields loaded into it.
I looped through the listbox to include square brackets [ ] incase the fields have a blank.
Here is my code:
Code:
Dim i As Integer
strSQL = "SELECT Toc.Name AS [Document Name], "
For i = 0 To lstSelection.Items.Count - 1
lstSelection.SelectedIndex = i 'Read through list box
strSQL &= "[" & lstSelection.Items(i).ToString & "]" & ", "
Next
'Removes the last comma
strSQL = strSQL.Substring(0, strSQL.Length - 2)
strSQL &= " FROM TD4"
Is there a way to tell which field is a SQL Server datetime field automatically then grab that field and CONVERT it with:
Code:
strSQL &= "CONVERT(VARCHAR(10), 101) AS " 'Whatever the datetime field is
Thanks!
Chris