Solved

Sybase searching for date

Posted on 2011-09-13
5
273 Views
Last Modified: 2012-05-12
I have a column in sybase table which has column values in this format

ABC TECH (11/09/09)*
CDE INC
FEG SYNC (11/09/10)*

I need to find all the records which have date in parenthesis followed by *. Please advise
0
Comment
Question by:saibsk
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
rbride earned 500 total points
ID: 36534404
Use the LIKE operator in your query

WHERE myCol LIKE '%([0-9][0-9]/[0-1][0-9]/[0-9][0-9])*'
0
 
LVL 3

Expert Comment

by:pg_vinod
ID: 36719638

simpler one would be:

WHERE myCol LIKE '%)*'
0
 
LVL 4

Expert Comment

by:rbride
ID: 36813268
@pg_vinod: your solution will find all rows where the field ends in )* including those that do not match the search criteria, such as "(abc)*"

My solution is not 100% sufficient because it will also find columns where date is invalid. To check that something really is a date is a whole chapter in itself.
0
 
LVL 29

Expert Comment

by:leonstryker
ID: 37271919
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The business world is becoming increasingly integrated with tech. It’s not just for a select few anymore — but what about if you have a small business? It may be easier than you think to integrate technology into your small business, and it’s likely…
In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question