SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to vaalidate Timestamp
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jaganreddy
Starting Member

India
10 Posts

Posted - 08/31/2013 :  03:44:21  Show Profile  Reply with Quote
How to validate timestamp,
i have tried so many time ,but iam not getting correct result, hwo to validate source data has timestamp or not ? i would like result s if the data is timestamp that should be 1, if the data is not timestamp that should be 0 ,iam using code like this
................................................................
CASE
WHEN TO_CHAR(OE_TECH_VLD_FROM_DTTM,'ddmonyyyy:hh:mi:ss.sssssss') then 1
ELSE 0
END

..................................................................

Thanks in Advance

Jagan

SwePeso
Patron Saint of Lost Yaks

Sweden
30282 Posts

Posted - 08/31/2013 :  04:02:33  Show Profile  Visit SwePeso's Homepage  Reply with Quote
Still using Oracle? Please ask over at www.dbforums.com, since SQLTeam is dedicated to Microsoft SQL Server.

In Microft SQL Server you would use a built-in function ISDATE() to test if the content can be interpreted as a date.



Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page

jaganreddy
Starting Member

India
10 Posts

Posted - 08/31/2013 :  05:11:17  Show Profile  Reply with Quote
quote:
Originally posted by SwePeso

Still using Oracle? Please ask over at www.dbforums.com, since SQLTeam is dedicated to Microsoft SQL Server.

In Microft SQL Server you would use a built-in function ISDATE() to test if the content can be interpreted as a date.



Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA







ISDATE() IS NOT WORKING, ERROR SHOWING LIKE INVALID OPERTOR ,


THANKS
JAGAN
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 08/31/2013 :  05:13:40  Show Profile  Reply with Quote
quote:
Originally posted by jaganreddy

quote:
Originally posted by SwePeso

Still using Oracle? Please ask over at www.dbforums.com, since SQLTeam is dedicated to Microsoft SQL Server.

In Microft SQL Server you would use a built-in function ISDATE() to test if the content can be interpreted as a date.



Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA







ISDATE() IS NOT WORKING, ERROR SHOWING LIKE INVALID OPERTOR ,


THANKS
JAGAN


Thats why you were instructed to post this in Oracle forums
The functions are different in Oracle

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

jaganreddy
Starting Member

India
10 Posts

Posted - 08/31/2013 :  06:15:11  Show Profile  Reply with Quote
No body knows answer for this question ????
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
30282 Posts

Posted - 08/31/2013 :  15:21:46  Show Profile  Visit SwePeso's Homepage  Reply with Quote
ISDATE(OE_TECH_VLD_FROM_DTTM)


Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 09/02/2013 :  08:32:28  Show Profile  Reply with Quote
quote:
Originally posted by jaganreddy

No body knows answer for this question ????


Whats stopping you from trying on Oracle forum if you're certain that you're using Oracle as the RDBMS?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

Lamprey
Flowing Fount of Yak Knowledge

4614 Posts

Posted - 09/03/2013 :  12:14:08  Show Profile  Reply with Quote
I'm not sure if you are using SQL Server or Oracle. If you are using SQL Sever, then you don't validate Timestamps as they are not dates:
quote:
Rowversion (Timestamp) is a data type that exposes automatically generated, unique binary numbers within a database. rowversion is generally used as a mechanism for version-stamping table rows. The storage size is 8 bytes. The rowversion data type is just an incrementing number and does not preserve a date or a time. To record a date or time, use a datetime2 data type.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000