You will want to use the YYYYMMDD for unambiguous date determination in SQL Server.
insert into table1(approvaldate)values('20120618 10:34:09 AM');
If you are married to the dd-mm-yy hh:mm:ss xm
format, you will need to use CONVERT with the specific style.
insert into table1 (approvaldate) values (convert(datetime,'18-06-12 10:34:09 PM',5));
5
here is the style for Italian dates. Well, not just Italians, but that’s the culture it’s attributed to in Books Online.
Related Posts:
- SQL query to select dates between two dates
- Rename column SQL Server 2008
- Efficiently convert rows to columns in sql server
- T-SQL split string based on delimiter
- Conversion of a varchar data type to a datetime data type resulted in an out-of-range value in SQL query
- How do I do multiple CASE WHEN conditions using SQL Server 2008?
- Get day of week in SQL Server 2005/2008
- How can I truncate a datetime in SQL Server?
- SQL Server WITH statement
- DateTime2 vs DateTime in SQL Server
- Conversion of a varchar data type to a datetime data type resulted in an out-of-range value in SQL query
- SQL Server Insert if not exists
- SQL Server: Invalid Column Name
- How do I do multiple CASE WHEN conditions using SQL Server 2008?
- How do I query for all dates greater than a certain date in SQL Server?
- How to insert date values into table
- Arithmetic overflow error converting numeric to data type numeric
- Determine ROW that caused “unexpected end of file” error in BULK INSERT?
- Determine ROW that caused “unexpected end of file” error in BULK INSERT?
- Microsoft OLE DB Provider for SQL Server error ‘80004005’
- Bulk load data conversion error (truncation)
- Convert timestamp to date in Oracle SQL
- Query to convert from datetime to date mysql
- Subtract one day from datetime
- Get current year in TSQL
- Can I use multiple “with”?
- How do I query for all dates greater than a certain date in SQL Server?
- Backup a single table with its data from a database in sql server 2008
- How can I group by date time column without taking time into consideration
- Arithmetic overflow error converting varchar to data type numeric. ’10’ <= 9.00
- Filter data based on date in sql
- Varchar invalid for Sum operator
- What is a stored procedure?
- Unknown column in ‘field list’ error on MySQL Update query
- SQL Inner-join with 3 tables?
- Conversion failed when converting date and/or time from character string while inserting datetime
- MySQL create table if not exists and insert record only if table was created
- error, string or binary data would be truncated when trying to insert
- ORA-00907: missing right parenthesis
- Why do we need “Relationships” between tables at all?
- Using group by on multiple columns
- SQL Query with NOT LIKE IN
- How to declare a variable in MySQL?
- ORA-01843 not a valid month- Comparing Dates
- How do I escape a single quote in SQL Server?
- Teradata: how to convert varchar value (format ‘dd.mm.yyyy’) to date (format ‘yyyy-mm-dd’ )?
- How Stuff and ‘For Xml Path’ work in SQL Server?
- Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
- Oracle SELECT TOP 10 records
- must appear in the GROUP BY clause or be used in an aggregate function
- How can I return pivot table output in MySQL?
- The multi-part identifier could not be bound
- MySQL syntax for Join Update
- SQLite – UPSERT *not* INSERT or REPLACE
- how to drop partition without dropping data in MySQL?
- Simple way to calculate median with MySQL
- The ALTER TABLE statement conflicted with the FOREIGN KEY constraint
- Error 1046 No database Selected, how to resolve?
- What is it exactly a BLOB in a DBMS context
- Insert text with single quotes in PostgreSQL
- SQL Server IF NOT EXISTS Usage?
- I want to use CASE statement to update some records in sql server 2005
- SELECT DISTINCT on one column
- TSQL PIVOT MULTIPLE COLUMNS
- MySQL – UPDATE multiple rows with different values in one query
- How to create a MySQL hierarchical recursive query?
- SQL Parentheses use in an OR clause
- Is it possible to GROUP BY multiple columns using MySQL?
- Equivalent of Oracle’s RowID in SQL Server
- Is there a Max function in SQL Server that takes two values like Math.Max in .NET?
- Best way to test if a row exists in a MySQL table
- sql query to return differences between two tables
- Is it possible to specify condition in Count()?
- SQL Server: Make all UPPER case to Proper Case/Title Case
- updating table rows in postgres using subquery
- Temporary table in SQL server causing ‘ There is already an object named’ error
- MySQL OPTIMIZE all tables?
- MySQL INSERT INTO table VALUES.. vs INSERT INTO table SET
- Is there a coalesce-like function in Excel?
- How do I count unique items in field in Access query?
- How to select the last record of a table in SQL?
- Sqlite: CURRENT_TIMESTAMP is in GMT, not the timezone of the machine
- MySQL LIKE IN()?
- What is a postgres superuser
- ora-06553 pls-306 wrong number or types of arguments in call to ‘ogc_x’
- SQL query to extract only the “current” wp_posts?
- How to retrieve sticky post in raw sql?
- How to remove in the wordpress database all posts revisions except the last three?
- Backticks (`) Instead of Single Quotes (‘) in an SQL Statement?
- $wpdb get_var issue
- WP Optimization: Removing Orphaned wp_options (especially the autoload ones)
- Auto-update tables from database
- Inserting rows into a custom table, when plugin is activated
- dbDelta not creating table (yes, once more)
- Posts modified in the last 48 hours
- post id not displaying
- How to export 2 week’s worth of posts
- Insert multiple checkbox values
- How to get EVENT based on startday, using BETWEEN
- wpdb prepare without placeholder