What can bite me if I store a datetime as a float in the database? I have a very good reason for doing it so don’t complain about that 🙂
Edit: I was thinking about just storing convert(float, @thedate) in a float column.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What can bite you? Well first float is not an exact datatype and thus should probably never be used for anything that requires precision. Next, float will not automatically reject an incorrect date. Next, if you want to perform any date functions you will first have to convert the data back to a datetime data type which is a waste of server resources.
You say you have a good reason for wanting to do this, but with a clue as to what that might be, I submit that the dates should be stored in the datatype meant to handle them.