Planet MySQL Planet MySQL: Meta Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 4

Displaying posts with tag: dates (reset)

Date Table Goodies (As Promised)
+0 Vote Up -0Vote Down

Goodies… but not the kind you can eat

You’re probably wondering, “What does this dandelion picture have to do with dates?” I wondered the same thing when I typed “calendar” into the image search box. Forget the dandelion. Let’s talk date table fun. On to the “goodies” I promised.In case you missed it, I posted earlier about the wonder of a “dates” table (Dates Tables (More Numbers Table Sugar)) I said I would probably make posts about why it is so wonderful. I like to deliver on what I promise.

Since the previous posts use …

  [Read more...]
Dates Tables (More Numbers Table Sugar)
+0 Vote Up -0Vote Down

Why A Table of Dates?

I thought it would be nice to build on the numbers table with another very useful tool.

Dates are pretty important–especially if you are playing with data warehousing. Not only dates, but all the different properties and derived goodies contained within them. You really don’t need a dates table, unless you care about efficiency and getting to all the good stuff quickly. Perhaps I’ll showcase some of the “goodies” in later posts.

Sure, most databases have built-in functions to get everything you might want. But do you really want all the inefficiency that comes with calling functions and doing …

  [Read more...]
MySQL datetime vs timestamp
+0 Vote Up -0Vote Down

Both data types: timespamp and datetime can be used to store a date and a time in a MySQL table. So what are the difference between these two and which one should I use in which cases? The usual use of timestamps in MySQL is in generall to track changes of record (fields like created, [...]

Searching Problems with Dates and Midnight
+0 Vote Up -0Vote Down

Today, we run into an issue when a client of ours. They wanted to see some of the data on our website and when doing a search, they didnt see all the days they asked for in the search

Why didn't they see all the data? Because they did a search by date and some of the dates were stored via the website in the form of '2008-01-01 00:00:00' and some were stored via the database in the form of '2008-01-01 12:35:49'.
Now, for some magical reason, if you hide the time in the date in your searches, like so:
where signupdate between '2008-01-01' and '2008-01-02'
where signupdate between date('2008-01-01 00:00:00') …

  [Read more...]
Showing entries 1 to 4

Planet MySQL © 1995, 2016, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.