Link to home
Start Free TrialLog in
Avatar of sdc248
sdc248Flag for United States of America

asked on

convert int to smalldatetime

Hi:

How do I convert an int to a smalldatetime?
The int has a format of yyyyMMddmmss. For example, 200707302345 means 7/30/2007 23:45.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sdc248

ASKER

The value is in decimal(12,0). Sorry my mistake. Is this the reason why I am getting NULL using your solution?
Avatar of sdc248

ASKER

Oh, lahousden's solution works. Thanks a lot.
I think only if the input value is NULL (that is, was not set).
Avatar of sdc248

ASKER

ScottPletcher:

I did some more tests and found that your solution was right, it was me making a mistake when testing it.  Now the points have been given to lahousden.  Do you know any way I can give you the same amount of points as well? Sorry.
Thanks, I appreciate that.

Depends on how many pts the initial q was for?  I think it was 150, but am not sure now.  If it was, you can open a q with a title like "Points for ScottPletcher for Q_22732029".  Remember, though, that according to EE rules, you cannot award more than 500 pts for any one q.
Avatar of sdc248

ASKER

I have doubled the assigned points (125, now 250) and splited it so ScottPletcher can get the points he deserves.

Thanks a lot guys.