Transact SQL, I guess... I'm building a dynamic querystring. I'm trying to compare a date provided by a user with a date/time stamp stored in the database -- I want to disregard the time and look only at the date itself.
I know there's no DATE_PART_ONLY_OF -- I was simply trying to show where I'm having the issue. That's what I'm trying to do, get ONLY the date part of that date/time column value.
I'm trying to use the CONVERT function now, but cannot quite figure it out.
what that does is: gets the system date (today's date) converts it to mm/dd/yy hh:mm:ss format; then returns only the first 8 characters (mm/dd/yy).
To test it, just add SELECT in front. Then you can replace the getdate() function with your column name, a variable, whatever has a datetime type.
By the way, in the future please start your own thread. Why? The person who creates the thread usually 'marks' the thread for email notification so they know when someone responds. Look at the beginning of this thread on the right side, there's a spot marked "Who's marked this thread?" Now the original poster is getting all these email notifications when none of them are responses to his/her post. So, this is a courtesy type of request.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.