如何将格式日期插入dd-mm-yyyy
数据类型列Date
?
尝试了以下但显示错误
INSERT INTO Profiles (first_name, last_name, email, phone,
[city(hometown)], created_at, gender,
referral_code,marital_status)
VALUES ('anusha', 'pariti', 'anusha.pariti@gmail.com', '8105987404',
'Bangalore', '16-04-2015', 'F', '7L5FZW', 'Y'),
('Ashish', 'Singh', 'ashish.singh@gmail.com', '9876890463',
'Bangalore','23-05-2015', 'M', 'KF34MF', 'Y')
错误:
从字符串转换日期和/或时间时转换失败。
INSERT INTO Profiles (first_name, last_name, email, phone,
[city(hometown)],created_at, gender,
referral_code, marital_status)
VALUES ('anusha', 'pariti', 'anusha.pariti@gmail.com', '8105987404',
'Bangalore', CAST('16-04-2015' AS DATE), 'F', '7L5FZW', 'Y'),
('Ashish', 'Singh', 'ashish.singh@gmail.com', '9876890463',
'Bangalore', CAST('23-05-2015' AS DATE), 'M', 'KF34MF', 'Y')
错误:
从字符串转换日期和/或时间时转换失败。
INSERT INTO Profiles (first_name, last_name, email, phone,
[city(hometown)], created_at, gender,
referral_code, marital_status)
VALUES ('anusha', 'pariti', 'anusha.pariti@gmail.com', '8105987404',
'Bangalore', CONVERT(DATE, '16-04-2015'), 'F', '7L5FZW', 'Y'),
('Ashish', 'Singh', 'ashish.singh@gmail.com', '9876890463',
'Bangalore', CONVERT(DATE, '23-05-2015'), 'M', 'KF34MF', 'Y')
错误:
从字符串转换日期和/或时间时转换失败。