Conversion Error From String Interbase
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of conversion error from string sql this site About Us Learn more about Stack Overflow the company Business Learn conversion error from string firebird date more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question firebird date format x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up conversion error from string, when using params in SQL up vote 1 down vote favorite using Delphi 2010 (Firebird [testing], MS Sql Server, Oracle [production]) The following is my SQL SELECT p.script_no, MIN(p.start_Time) as startTime, MAX(p.end_Time) as endTime, SUM(p.duration) as TotalDuration FROM phase_times p WHERE (p.script_no=:scriptNo) AND (Trunc(p.start_time) >= :beginDateRange) AND (Trunc(p.start_time) <= :endDateRange) GROUP BY p.script_no ParamByName('beginDateRange').AsDate:= Date - 30; ParamByName('endDateRange').AsDate:= Date; I am getting a "conversion error from string - 10-25-2012" and i am not sure why, since my datetime fields are in the "10/25/2012 9:20:49 AM" format in the database. If i change it to the following : ParamByName('beginDateRange').AsString := formatDateTime('mm/dd/yyyy',Date - 30).....i get the error "conversion error from string - 10/25/2012" reserching this error has provided me no new avenues, do you have any ideas? delphi delphi-2010 firebird share|improve this question edited Oct 25 '12 at 14:46 ain 16.4k22854 asked Oct 25 '12 at 14:38 Blow ThemUp 3901925 3 What is the data type of the start_Time field? (VAR)CHAR or TIMESTAMP? –ain Oct 25 '12 at 14:45 both begin and end date fields are datetime –Blow ThemUp Oct 28 '12 at 23:25 @Jake - Firebird does not have a datetime data type. –Sertac Akyuz Oct 29 '12 at 15:44 add a comment| 3 Answers 3 active oldest votes up vote 4 down vote accepted According to the Interbase 6.0 manual, Embedded SQL guide, chapter 7, Firebird supports conversion from YYYY-MM-DD and YYYY-MM-DD HH:MM:SS.qqq. I also believe it supports American style shorthand dates (eg 1-JAN-2012)
[1] 2 вперед Ctrl→ все conversion error from string [new] MPD Member Откуда: Санкт-Петербург Сообщений: 175 Есть поле STAT_TIME где хранится некая дата (TIMESTAMP) со значением 24.07.2006 5:37:08 (в 24 часовом формате), делаю такой запросselect * from BASE where STAT_TIME<'7/24/2006 5:48:59 AM'Далее возникает сообщение об ошибке:conversion error from string "7/24/2006 5:48:59 AM"В чем ошибка? 24 июл 06, 10:17 [2916262] Ответить | Цитировать Сообщить модератору Re: conversion error from string [new] Aleksey Kh. Member Откуда: СПб Сообщений: 323 а если дату "2006-07-24" указать? 24 июл 06, 10:29 [2916318] Ответить | http://stackoverflow.com/questions/13071007/conversion-error-from-string-when-using-params-in-sql Цитировать Сообщить модератору Re: conversion error from string [new] MPD Member Откуда: Санкт-Петербург Сообщений: 175 Aleksey Kh.а если дату "2006-07-24" указать?Ошибка не в FormatDateTime - перепробовал почти все комбинации, а именно в самом запросе как я понимаю...Запись вносится в поле по триггеру NEW.stat_time=current_timestamp;Ведь не имеет значения для сравнения дат и времени их формата (12 или 24 часовой)? 24 июл 06, http://www.sql.ru/forum/317981/conversion-error-from-string 10:34 [2916343] Ответить | Цитировать Сообщить модератору Re: conversion error from string [new] Dimitry Sibiryakov Member Откуда: Сообщений: 41690 MPDconversion error from string "7/24/2006 5:48:59 AM"В чем ошибка?FB понимает время только в 24-х часовом формате. Соответственно, никаких АМ/РМ.Posted via ActualForum NNTP Server 1.3 24 июл 06, 10:37 [2916358] Ответить | Цитировать Сообщить модератору Re: conversion error from string [new] Лентяй Member Откуда: Сообщений: 2804 MPDВедь не имеет значения для сравнения дат и времени их формата (12 или 24 часовой)?Из каких соображений сделан такой вывод? Уж ли не из чтения ли документации? 24 июл 06, 10:41 [2916372] Ответить | Цитировать Сообщить модератору Re: conversion error from string [new] MPD Member Откуда: Санкт-Петербург Сообщений: 175 Dimitry Sibiryakov MPDconversion error from string "7/24/2006 5:48:59 AM"В чем ошибка?FB понимает время только в 24-х часовом формате. Соответственно, никаких АМ/РМ.Posted via ActualForum NNTP Server 1.3Если я преобразую дату таким образом: FormatDateTime('dd.mm.yyyy hh:nn:ss',now), то возникает другая ошибка Error:'24.07.2006 06:45:06' is not a valid date and time 24 июл 06, 10:48 [2916402] Ответить | Цитировать Сообщить модератору Re: conversion error from string [new] MPD Member Откуда: Санкт-Петербург Сообщений: 175
van GoogleInloggenVerborgen veldenZoeken naar groepen of berichten
Search Username Password Remember Me? Register Lost Password? facebook google twitter rss Free Web Developer Tools Advanced Search Forum Databases Firebird SQL Development Overflow occurred during data type conversion. Conversion error from string "$$$###" Thread: Overflow occurred during data type conversion. Conversion error from string "$$$###" Share This Thread Tweet This + 1 this Post To Linkedin Subscribe to this Thread Subscribe to This Thread March 21st, 2010,10:51 PM #1 No Profile Picture belzedar View Profile View Forum Posts Registered User Devshed Newbie (0 - 499 posts) Join Date Mar 2010 Posts 3 Rep Power 0 Overflow occurred during data type conversion. Conversion error from string "$$$###" The following queries result in the error - Overflow occurred during data type conversion. Conversion error from string "$$$###". when running this in EMS Manager Lite or inside a delphi/report builder application. Select tbl1.FIRSTNAME, tbl1.Image2, Sum(FieldA) as TotalFieldA from Table1 tbl1 inner join Table2 tbl2 on tbl1.REG = tbl2.REF Group By tbl1.FirstName, tbl1.IMAGE2 If the references to the IMAGE2 field is removed in the select and the group by then the query is fine. So is there some sort of issue where an Image (BLOB field) cannot be selected in a SQL Statement with a summing function. The Standard Select * from Table1 shows the image field no problem. FYI - using Delphi 7 and Firebird 1.5.2 Faq Reply With Quote March 21st, 2010,11:35 PM #2 No Profile Picture clivew View Profile View Forum Posts Visit Homepage Contributing User Devshed Regular (2000 - 2499 posts) Join Date Jan 2006 Location Carlsbad, CA Posts 2,057 Rep Power 385 I don't see how you can do a GROUP BY on a BLOB field. I'm quite surprised that Firebird actually accepts the SQL. I have not double checked, so I could be wrong Clive Faq Reply With Quote March 22nd, 2010,12:04 AM #3 No Profile Picture belzedar View Profile View Forum Posts Registered User Devshed Newbie (0 - 499 posts) Join Date Mar 20