Viewing 15 posts - 2,311 through 2,325 (of 2,443 total)
Normally, that would solve my problem, but I can't create a function. Only temp objects. DBAs have the system locked down pretty tight, still arguing with them over whether they...
September 26, 2008 at 6:31 am
rbarryyoung (9/24/2008)
September 25, 2008 at 6:32 am
thanks Lynn, I knew there had to be a better way. 🙂
Why does that make a difference though? converting from datetime to varchar is implicit; converting from varchar to datetime...
September 24, 2008 at 3:20 pm
worth a shot, if we try to parse a string that doesn't exist, it's likely to give us trouble. Any chance you know how to populate those fields?
If not,...
September 24, 2008 at 3:01 pm
I think your
UPDATE temp_ameriflex_detail
SET emp_doh = convert(char,emp_doh,112)
completes successfully because it's not changing to a date, just formatting varchar as char, which isn't really changing anything.
Try this and see...
September 24, 2008 at 2:42 pm
ok, quick example -
'9/1/2008' has two slashes, and you know now that you can find the first slash by doing charindex('/',emp_doh,1) telling the Charindex() function to start at 1.
If...
September 24, 2008 at 12:17 pm
Look up CHARINDEX in BOL, and replace the number in the Substring function with the position of your '/' plus one.
see http://www.sqlservercentral.com/articles/String+Manipulation/63604/ for some recent article/discussion on this.
😀
September 24, 2008 at 10:53 am
Right, if it's already datatype of varchar, you'll have to convert to a string to put anything in it.
I would suggest you add a column with a datatype...
September 24, 2008 at 10:41 am
themissnlink (9/24/2008)
UPDATE temp_ameriflex_detailSET emp_doh = convert(datetime,emp_doh,112)
This gets the following error:
Msg 241, Level 16, State 1, Line 1
Conversion failed when converting datetime from character string.
I'm assuming...
September 24, 2008 at 10:08 am
themissnlink (9/24/2008)
September 24, 2008 at 9:11 am
Shah (9/23/2008)
i faced the same problem in past, when the ' (single quote) appear in a string...
September 24, 2008 at 6:16 am
vaioks (9/17/2008)
I am trying to Import a flat file (delimited) into a SQL server table. the was created from a unility which is not too flexible. I have the date...
September 24, 2008 at 5:58 am
We just came across this question at work. While the USPS would be the 'authority' on US zip codes, whether it is correct for your business depends on how...
September 24, 2008 at 5:50 am
I'm not quite sure how you could assign a 'per row' cost, unless you were ignoring litigation costs associated with data loss (http://www.sqlservercentral.com/articles/Editorial/64241/). In the healthcare industry, we'd also have...
September 24, 2008 at 5:36 am
Agree with Quatrei.X, sample data would be better, but check this out too and see if it helps -
http://www.sqlservercentral.com/articles/Advanced+Querying/calculatingworkdays/1660/
Lots of questions when you start looking at workdays/hours/such, since holidays...
September 22, 2008 at 6:56 am
Viewing 15 posts - 2,311 through 2,325 (of 2,443 total)