March 10, 2019 at 1:48 am
March 10, 2019 at 4:46 am
From Google Translate
Is it possible to update values based on wildcards? For example, I have many days in the database formatted with different criteria and I want them all to be MM / DD / YYYY. To make things a little different, the value inside this field can represent anything, not just a day. I want to only update the values kept on the wrong format.
So I made a query:
choose the distinct IndexFieldText from dbo.DocumentField in which IndexFieldText like '% / _ /%'
This will only bring the date values to a single digit.I can update these values by using the update query with a wildcard, such as:
update dbo.tablename set IndexFieldText = '% / 0 _ /%' where IndexFieldText is like '% / _ /%'
No, you cannot use the wildcards in the update.
March 10, 2019 at 5:54 am
If that Google translate is to be relied on, your statement about changing the format of your dates is a little confusing. You don't store the format of a date in SQL Server, they are stored as a binary values; your presentation layer then does the formatting. You can't change the format of a date in the data.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
March 10, 2019 at 8:04 am
Thom A - Sunday, March 10, 2019 5:54 AMIf that Google translate is to be relied on, your statement about changing the format of your dates is a little confusing. You don't store the format of a date in SQL Server, they are stored as a binary values; your presentation layer then does the formatting. You can't change the format of a date in the data.
Based on this statement, I take it to be an EAV table, where the Attribute Value is stored as a varchar.
To make things a little different, the value inside this field can represent anything, not just a day
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy