Viewing 15 posts - 61 through 75 (of 172 total)
Quick note on my above script, the string does not have to be converted to datetime, it's implicity performed (run the script).
September 14, 2004 at 9:28 am
Hello.
If you still need a more detailed example then you may want to use the Build Query button in the Transform Data Task. This option will give you a GUI...
September 13, 2004 at 3:23 pm
try this
DECLARE @Month varchar(50),
@Day varchar(50),
@Year varchar(50),
@Date datetime
Set @Month = '9'
Set @Day = '13'
Set @Year = '2004'
Set @Date = @Month + '/' + @Day + '/' + @Year
print @date
September 13, 2004 at 3:14 pm
Ouch. The problem being that you really don't want to stick the 10 joined tables into the subquery in order to find one lousy data point. I don't know any...
September 13, 2004 at 9:53 am
Hmm, didn't even think of checking the Year and Month order by part of your statement but yeah, string sorting is performed one character at a time with blank (or...
September 13, 2004 at 9:35 am
The problem is there's no easy way to compare only dates in a datetime field. I know of a couple of ways to do it that require one extra step.
...
September 11, 2004 at 10:41 am
I don't know what the problem is but my next step would be to run a trace.
Good luck.
September 10, 2004 at 11:11 pm
I didn't test this, but..
SELECT ActualTable.*
FROM ActualTable
INNER JOIN
(SELECT Min(Priority) AS Priority
FROM ActualTable
WHERE Value > 15) MinPriority
ON ActualTable.Priority = MinPriority.Priority
Note that this will return all records...
September 10, 2004 at 11:07 pm
Hello
The CONVERT function allows one to choose the date format the actual comparison takes place in.
101 is the mm/dd/yyyy format
103 is dd/mm/yyyy
Look up CONVERT on BOL for the full...
September 10, 2004 at 6:03 pm
My understanding is that datetime will hang on to the time element, meaning you either need to set all datetimes to one time (midnight) or perform the comparison in a...
September 10, 2004 at 5:51 pm
I believe the ASCII function produces values based on the first character (at least it did on my test server). Try this:
use Northwind
declare @SortBy char(10)
select @sortBy = 'Name'
SELECT...
September 10, 2004 at 5:46 pm
sorry for not having a cleaner example but it boils down to using the DATEADD funciton.
CASE WHEN AwardDate = CONVERT(varchar(12), DATEADD(day, -6, GETDATE()), 101) THEN 1
ELSE 0 END AS AcceptInd,
September 10, 2004 at 5:35 pm
Would converting to a string answer your problem? For example, the select statement below finds all of the sales made on one date. The print statement are an example of...
September 10, 2004 at 2:56 pm
No doubt your way is faster. Not to metion it's a good habit to accomplish tasks without using cursors since it helps train to mind to see cursor free solutions.
September 10, 2004 at 12:53 pm
I think Bruce's idea of a table is still worth keeping in the back of your mind. If I'm ever really, REALLY bored and need a challenge I plan on moving...
September 10, 2004 at 9:15 am
Viewing 15 posts - 61 through 75 (of 172 total)