By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,018 Members | 930 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,018 IT Pros & Developers. It's quick & easy.

TIMESTAMPs and WHERE

P: n/a
Can I use wildcards with a TIMESTAMP attribute? If not, what is the
resulting format when I CAST it as VARCHAR? Now that I think about it, I
need the same questions answered for DATEs too.

Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Robert Stearns wrote:
Can I use wildcards with a TIMESTAMP attribute? If not, what is the
resulting format when I CAST it as VARCHAR? Now that I think about it, I
need the same questions answered for DATEs too.

Can you give an example? It's unclear what you mean to me.

Cheers
Serge
Nov 12 '05 #2

P: n/a
Serge Rielau wrote:
Robert Stearns wrote:
Can I use wildcards with a TIMESTAMP attribute? If not, what is the
resulting format when I CAST it as VARCHAR? Now that I think about it,
I need the same questions answered for DATEs too.

Can you give an example? It's unclear what you mean to me.

Cheers
Serge

Sure: everything in March of this year: like 2004-03%
every thing that ran on the first of any month: like ____-__-01%
anything done after 7PM before 7AM: like ____-__-__-19% or like
____-__-__-20% ... (Wouldn't a full regular expression accepting like be
nice?)

Nov 12 '05 #3

P: n/a
Robert,

CHAR(tstamp, ISO) LIKE '......' should do it.

Cheers
Serge
Nov 12 '05 #4

P: n/a
Ian
Robert Stearns wrote:
Serge Rielau wrote:
Robert Stearns wrote:
Can I use wildcards with a TIMESTAMP attribute? If not, what is the
resulting format when I CAST it as VARCHAR? Now that I think about
it, I need the same questions answered for DATEs too.

Can you give an example? It's unclear what you mean to me.

Cheers
Serge


Sure: everything in March of this year: like 2004-03%


You can't do where year(ts) = 2004 and month(ts) = 3?
Have you seen the YEAR, MONTH, DAY, HOUR ... functions that operate
on timestamps, dates and/or times?

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.