I have some queries where day offsets are being coded as utc_date + 1 rather than using the date_add function. Are their any implications of using this method? I'm worried about it returning the wrong result in some circumstances, especially when the result date rolls over to a different month
MySQL Implications of doing utc_date + 1 rather than using date_add(utc_date, interval 1 day)
321 Views Asked by Tarski At
1
There are 1 best solutions below
Related Questions in MYSQL
- How to Retrieve Data from an MySQL Database and Display it in a GUI?
- How to change woocomerce or full wordpress currency with value from USD to AUD
- window.location.href redirects but is causing problems on the webpage
- Error: local variable 'bramka' referenced before assignment
- Products aren't displayed after fetching data from mysql db (node.js & express)
- status table for all entries (even in different dates) in database changing value when all checkboxes are checked
- Can't Fix Mariadb & Mysql ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mysql.sock' (2) On MacOs
- Express Mysql getting max ID from table not working cought in a promise
- failed to upload a table from sql file
- Update a MySQL row depending on the ID in Google Sheets Apps Script
- Use row values from another table to select them as columns and establish relations between them (pivot table)
- SQL: Generate combination table based on source and destination column from same table
- How to display the column names which have only unique non-null values in MySQL table?
- mysql query takes too long because of wrong indexes usage
- Multitable joining in Sql
Related Questions in DATE
- Using JQuery Date Slider
- Get Type Error when using .countDocuments with mongoDB
- Gsheet - Automatically send an email using a date & time in a Cell
- Market share growth versus last month, last year
- Convert date string into a number in Python
- Date formatting "yyyy-MM-dd hh:mm:ss +0000" to "dd MMM" in swift
- How does Big Query differentiate between a day and month when we upload any CSV or text file?
- Event_date reference in CTE
- Laravel Nova 4 format date in BelongsTo field
- how to count days elpased between each interval using mySQL?
- MariaDB incorrect dates
- Date issue - how do I parse date in this SQL
- Countdown to varying payday in Javascript
- Can I have a static ISO8601DateFormatter with specific formatOptions in Swift?
- Date Format mdy vs dmy
Related Questions in DATEADD
- Batch Work Order Generation with Variable Dateadd Function
- Access query DateAdd with between x and y
- Return and the past price calculation in power BI with no correlated dates
- Power BI DATEADD function returns blank for future dates
- query that can count and check process time if it is in shift schedule range
- DAX - how to compute 4 steps of calculation requiring 4 columns in only one DAX formula / resulting in one column
- SQL Using Case with date function
- JdbcSQLSyntaxErrorException function DATE_ADD not found
- Sql server min and max dates between 2 columns and multiple rows
- Power Apps set(var for DateAdd is blank
- Given a date I want to find the last date that is not a weekend and does not exist in a list of other dates
- Dateadd function doesnt completely showing all previous months value
- missing value in a column using DATEADD function in dax power bi
- SQL Statement working in client but not within SSIS / Visual Studio
- SQL adding a number of months onto a date
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Using the above query (on MySQL 5.0.51a), I get the following results:
utc_date()+1= 20110204date('2011-02-28')+1= 20110229date_add('2011-02-28', INTERVAL 1 DAY)= 2011-03-01So it appears that simply adding 1 to the date causes mysql to treat the date value as an integer and not as a date. I'd recommend changing your code to use date_add.