Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to vaalidate Timestamp

Author  Topic 

jaganreddy
Starting Member

10 Posts

Posted - 2013-08-31 : 03:44:21
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

30421 Posts

Posted - 2013-08-31 : 04:02:33
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

10 Posts

Posted - 2013-08-31 : 05:11:17
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

52326 Posts

Posted - 2013-08-31 : 05:13:40
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

10 Posts

Posted - 2013-08-31 : 06:15:11
No body knows answer for this question ????
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2013-08-31 : 15:21:46
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

52326 Posts

Posted - 2013-09-02 : 08:32:28
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
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2013-09-03 : 12:14:08
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
   

- Advertisement -