Get Properly Formatted Date From ASP.net membership profile using fn_GetProfileElement
Posted on 2009-04-20
I have a web app that uses the ASP.net Membership provider and I am currently working with a view that extracts the profile values into separate columns using the fn_GetProfileElement function. Everything so far works great except for any Profile fields that are dates. In the view, my datetime fields are shown as the XML string and not just the date.
For example, if I call the follwing SQL:
SELECT dbo.fn_GetProfileElement('Birthdate', PropertyNames, PropertyValuesString) As Birthdate
The result is the birthday's for all my users in the following format:
<?xml version="1.0" encoding="utf-16"?>
What I really need is for it to just be just the date in the standard SQL format. Anyone know how to get this done?