<p>Scenario:
 A stored procedure receives from code a DateTime with, let's say DateTime.Now value, as a datetime parameter.
 The stored procedure needs to store only the date part of the datetime on the row, but preserving all date related arithmetics for, to say, do searches over time intervals and doing reports based on dates.</p>

<p>I know there is a couple of ways, but what is the better having in mind performance and wasted space? </p>

[{'answer_id': 79961, 'author': 'Jared', 'author_id': 1980, 'author_profile': 'https://Stackoverflow.com/users/1980', 'pm_score': 0, 'selected': False, 'text': '<p>store the date with time = midnight</p>\n\n<p>EDIT: i was assuming MS SQL Server</p>\n'}, {'answer_id': 80002, 'author': 'Encoder', 'author_id': 14629, 'author_profile': 'https://Stackoverflow.com/users/14629', 'pm_score': 0, 'selected': False, 'text': "<p>Essentially you're only going to store the Date part of your DateTime object. This means regardless of how you wish to handle querying the data the Date returned will always be set to 00:00:00.</p>\n\n<p>Time related functions are useless in this scenario (even though your original DateTime object uses them) as your database drops this info.</p>\n\n<p>Date related arithmetics will still apply though you will have to assume a time of midnight for each date returned from the database.</p>\n"}, {'answer_id': 80026, 'author': 'Tom Carr', 'author_id': 14954, 'author_profile': 'https://Stackoverflow.com/users/14954', 'pm_score': 3, 'selected': True, 'text': "<p>Business Logic should be handled outside of the proc.  The procs jobs should be to save the data passed to it.  If the requirment is to only store Date and not time, then the BL/DL should pass in DateTime.Now**.Date** (or the equiv...basically the Date part of your DateTime object).</p>\n\n<p>If you can't control the code for some reason, there's always convert(varchar(10), @YOURDATETIME, 101)</p>\n"}, {'answer_id': 80190, 'author': 'TonyOssa', 'author_id': 3276, 'author_profile': 'https://Stackoverflow.com/users/3276', 'pm_score': 0, 'selected': False, 'text': '<p>SQL Server 2008 has a date only type (DATE) that does not store the time. Consider upgrading.</p>\n\n<p><a href="http://www.sqlteam.com/article/using-the-date-data-type-in-sql-server-2008" rel="nofollow noreferrer">http://www.sqlteam.com/article/using-the-date-data-type-in-sql-server-2008</a></p>\n'}, {'answer_id': 86232, 'author': 'Mike McAllister', 'author_id': 16247, 'author_profile': 'https://Stackoverflow.com/users/16247', 'pm_score': 0, 'selected': False, 'text': "<p>If you're working on Oracle, inside your stored procedure use the TRUNC function on the datetime. This will return ONLY the date portion.</p>\n"}]
['https://Stackoverflow.com/questions/79949', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6359/']