Conversion Error From String Delphi Data
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 this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question 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 Interbase: conversion error from string “” up vote 1 down vote favorite I'm running IB2009 and I'm trying to count the number of records where a specific field is neither NULL nor empty: SELECT COUNT(A.ID) FROM MYVIEW A WHERE ((A.VARCHARFIELD1 IS NOT NULL) OR (A.VARCHARFIELD1 <> '')) where MYVIEW is a VIEW, and MYVIEW.ID is an INTEGER, while MYVIEW.VARCHARFIELD1 is a VARCHAR(18). I'm getting the error message Error at line 1, conversion error from string "" which I don't really understand, since when I drop the COUNT()-function, the query executes nicely. Do anyone know what I'm doing wrong? Thanks! sql interbase share|improve this question edited Jan 15 '10 at 11:49 asked Jan 15 '10 at 10:22 conciliator 3,26832656 add a comment| 1 Answer 1 active oldest votes up vote 1 down vote I don't see anything wrong with using COUNT() in this case. Although it shouldn't matter you might try dropping all the parentheses in your WHERE clause. You also might try using COUNT(*) instead of COUNT(A.ID) just to see if it gives you different results. In any case, based on your description of the intent of the query I don't think that the query is going to do what you intended. If the query is supposed to return rows where the field is neither NULL nor empty I believe your WHERE clause shoul
we will discuss things relating the ZEOSLib 6.6.x stable versions Moderators: gto, EgonHugeist Post Reply Print view Search Advanced search 3 posts • Page 1 of 1 louis Senior Boarder Posts: 56 Joined: 02.01.2009, 19:41 SQL Error: conversion error from string "0" Quote Postby louis » 03.02.2009, 10:18 Hallo, I have this error message: SQL Error: conversione error from string "0". Error Code: -413. Overflow occurred during datatype conversion. I use delphi 5 with zeos 6.6.4. I need to use a TTimeField that can have 0.00 time inside but when I try to save the query, I have the error above in unit ZDbcInterbase6Utils. I understand this is because the http://stackoverflow.com/questions/2070789/interbase-conversion-error-from-string time is empty but what I do to solve this problem? Thanks. Top mdaems Zeos Project Manager Posts: 2766 Joined: 20.09.2005, 15:28 Location: Brussels, Belgium Contact: Contact mdaems ICQ WLM Yahoo Messenger Quote Postby mdaems » 03.02.2009, 10:52 Hi, Can you please file a bug report on the bug tracker? ( http://zeosbugs.firmos.at/ ) Please attach a minimal project showing the error and the script needed to set up the database. Mark Top louis Senior Boarder http://zeoslib.sourceforge.net/viewtopic.php?t=2219 Posts: 56 Joined: 02.01.2009, 19:41 Quote Postby louis » 03.02.2009, 16:12 mdaems wrote:... Please attach a minimal project showing the error and the script needed to set up the database. Hi Mark, while I prepared the example I have uncovered where I mistook. During create table in database I assigned wrong default, see wrong code: Code: Select allCREATE TABLE CEDOLINI
(
ID_CEDOLINO Integer NOT NULL,
GIORNO1 Time DEFAULT 0 NOT NULL, <--- ERROR
PRIMARY KEY (ID_CEDOLINO)
);but the line correct is:Code: Select all GIORNO1 Time DEFAULT '00.00' NOT NULL, <--- CORRECT!
Thanks Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Post Reply Print view 3 posts • Page 1 of 1 Return to “6.6 - stable†Jump to ZEOS Library - General Announcements Downloads Documentations Tutorials ZEOS DBO v7.x ZeosLib 7.2 Betatest Forum ZeosLib 7.1 stable Forum ZeosLib 7.0 Stable Forum ZeosLib 7.0 Beta Forum ZEOS DBO V 6.x 6.6 - stable 6.5.1 (alpha) - 6.6.x (beta) 6.1.5 Other 6.x Versions ZDBC (ZEOS Database Connectivity) User Contributions User Patches Feature Requests Bug Reports ZEOS DBO V 5.x 5.x Versions SQL Servers and Databases ADO DB2 Fire
Artigos Revistas Revistas Voltar Front-end Magazine Mobile magazine Java Magazine easy Java Magazine .net Magazine easy .net Magazine http://www.devmedia.com.br/forum/filtro-por-data-erro-conversion-error-for-string-0/436991 SQL Magazine Clube Delphi Infra Magazine Engenharia de Software Assine revistas Serviços Serviços Voltar Cadastre-se RSS APIs RECOMENDADO Fórum Fale conosco DevMedia Baixe o APP Login OK Cadastre-se Esqueci minha senha NOVO! Cursos #ShowMeTheCode Mostrar menu Tópicos Recentes Perguntas Exemplos Tags Meus Tópicos Pesquisar Array ( ) Filtro por data (erro:conversion error for string 0) conversion error Delphi Sanz   - 13 mar 2013 Bom dia, Estou precisando de uma força se alguem tiver conhecimento, utilizo ibtable e ibquerye o banco de dados firebird 2.5 Estou tentando fazer um filtro por um de terminado período de data selecionado pelo usuário atraves de 2 TSDATEEDIT, porém esstá dando o seguinte ERRO: conversion error for conversion error from string 0) Vou postar os códigos abaixo: #Código DM.ibtblEntPai.Filtered:= False; DM.QrySQL.Close; DM.QrySQL.SQL.Clear; DM.QrySQL.SQL.Add('select CA.ENTPAI_NOTA, CA.ENTPAI_ID_FORNECEDOR, CA.ENTPAI_DATA_ENTRADA,CO.NOME_FORN,CA.entpai_vencimento'); DM.QrySQL.SQL.Add('FROM ent_pai CA LEFT JOIN FORNECEDOR CO ON (CA.ENTPAI_ID_FORNECEDOR = CO.ID_FORN)'); DM.QrySQL.SQL.Add('WHERE CA.ENTPAI_DATA_ENTRADA BETWEEN :DE and :ATE' ); DM.QrySQL.ParamByName('DE').AsString:=Formatdatetime('dd/mm/yyyy',sDateinicial.date); DM.QrySQL.ParamByName('ATE').AsString:= Formatdatetime('dd/mm/yyyy',sDateFinal.Date); dataini:= DM.QrySQL.ParamByName('DE').AsString; datafim := DM.QrySQL.ParamByName('ATE').AsString; DM.QrySQL.Open; if not DM.QrySQL.IsEmpty then begin DM.ibtblEntPai.Filter:= ('ENTPAI_DATA_ENTRADA BETWEEN ' + dataini + ' AND ' + datafim); DM.ibtblEntPai.Filtered:= True; end; else begin Application.MessageBox('Não foi encontrado nenhuma nota fiscal para esse Período!','Mensagem do Sistema',MB_ICONINFORMATION + MB_OK); DM.ibtblEntPai.Filtered:= False; end; O campo data ENTPAI_DATA_ENTRADA está com formato DATE no banco. Obrigado.
Mais posts Felipern| MVP Currículo    13 mar 2013 Boa tarde. Não estou acostumado a usar o Filter. Mas eu tentaria alterar isso:Citação: DM.ibtblEntPai.Filter := ('ENTPAI_DATA_ENTRADA BETWEEN ' + dataini + ' AND ' + datafim); Por isso:Citação: DM.ibtblEntPai.Filter := ('ENTPAI_DATA_ENTRADA BETWEEN ' + QuotedStr(dataini) + ' AND ' + QuotedStr(datafim)); Espero que te ajude. 0|0 Sanz   - 13 mar 2013 Espero que te ajude. Boa tarde Felipe, Executei a sua