467,200 Members | 1,008 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,200 developers. It's quick & easy.

TIMESTAMPs and WHERE

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
  • viewed: 1528
Share:
4 Replies
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
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
Robert,

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

Cheers
Serge
Nov 12 '05 #4
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.

Similar topics

7 posts views Thread by lkrubner@geocities.com | last post: by
10 posts views Thread by Craig Wahlmeier | last post: by
5 posts views Thread by Robert Schuldenfrei | last post: by
4 posts views Thread by Craig G | last post: by
1 post views Thread by Erwin Van de Velde | last post: by
16 posts views Thread by maruk2@hotmail.com | last post: by
1 post views Thread by maruk2@hotmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.