Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Type casting

by monkeygirl (Pilgrim)
on Jul 18, 2001 at 05:03 UTC ( [id://97510]=note: print w/replies, xml ) Need Help??


in reply to Type casting

MS Access is really funny. They store their dates in yyyy-mm-dd hh:mm:ss format, no matter how you think it looks in the table. And you can't simply write that format into the date field. :(

I ran into a similar issue a while back when trying to write a date to an MS Access database. I ended up having to use {ts '2001-01-01 23:59:59'} to pull it off. Granted, your issue may be unrelated, but if you're looking for dates, you may have to write them too.

So, anyway, back to your question: I tried this out earlier, and it should suit your needs, but is most likely a quick hack:

WHERE field BETWEEN #1/1/$year# AND #12/31/$year#

Update: While sifting through the Cheetah Book (Programming the Perl DBI), I noticed that on page 293 it says this:

Similar escape sequences are defined for other date/time types. Here's the full set:
{d 'YYYY-MM-DD'} - date {t 'HH:MM:SS'} - time {ts 'YYYY-MM-DD HH:MM:SS'} - timestamp {ts 'YYYY-MM-DD HH:MM:SS.FFFFFFF'} - timestamp

Further research at that dratted MSDN does indeed indicated that that is the full set


Sarah
If Bill Gates can name a company after his "bedroom" problems, I can have a stupid sig that points it out.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://97510]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-16 11:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found