![]() Below, is a DATEPART example that once again returns all the records that have a SAMPLE_DATE in ''.Īs I have said before there are many ways to accomplish the same thing. With the DATEPART function you can build a WHERE statement that breaks apart each piece (year, month, day) of the SAMPLE_DATE and verifies that each piece is equal to the year, month and day you are looking for. This record would not be returned because when SQL Server converts the string '' to a date/time value it would be equal to the SAMPLE_DATE on record 4.Īnother way to return the records that have a SAMPLE_DATE for a particular date is to use the DATEPART function. If only the greater than sign was used the SELECT statement would not return record 4. ![]() Here's what I found while playing around, please let me know if it helps you.ĪND SAMPLE_DATE =) expression instead of just greater than (>). ![]() Okay, we're getting a little out of my league here, but I'll try to help.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |