TFDQuery Data Type returns wrong type

I need to know if the data type of a field (the name stored in a string 
variable) in a TFDQuery result is date or datetime (MS-SQL 2008 R2, 
DXE5, W7Pro) in this
{code}
if ((FDQuery1.FieldByName(LookupField).DataType = TFieldType(9)) or 
(FDQuery1.FieldByName(LookupField).DataType = TFieldType(11))) then
....
// or in this

if ((FDQuery1.FieldByName(LookupField).DataType = ftDate ) or 
(FDQuery1.FieldByName(LookupField).DataType = ftDateTime)) then
....
but it always returns false
Is there a property to be set to get this information?
Best Regards
Francisco Alvarado
0
Francisco
2/6/2014 10:02:48 PM
embarcadero.delphi.firedac 822 articles. 2 followers. Follow

2 Replies
2689 Views

Similar Articles

[PageSpeed] 27

Hello Francisco

DATE -> ftDate
DATETIME -> ftTimeStamp

-- 
With best regards,
Dmitry Arefiev / FireDAC Architect
FireDAC - Firebird, SQLite, MySQL, SQL Server, Oracle, PostgreSQL, 
DB2, SQL Anywhere, Access, Informix, ODBC high-speed data access lib
0
Dmitry
2/7/2014 11:22:21 AM
On 2/7/2014 4:22 AM, Dmitry Arefiev wrote:
> Hello Francisco
>
> DATE -> ftDate
> DATETIME -> ftTimeStamp
>
Thank you Dimitry!
0
Francisco
2/7/2014 1:40:13 PM
Reply:

Similar Artilces:

A JAVA Vector data type is returned to a powerbuiler ? Data Type
If a java class in jaguar is to pass powerbuiler a vector of strings, what is the pb datatype? I would think: String ls_jag_return[] ABL You can't pass a vector. You will have to pass an array. Carson ___________________________________________________________ Carson Hager Team Sybase Dynamic Data Solutions, Inc. Enterprise Application Studio 3.0 Consulting and Training http://www.dyn-data.com DDS is now hiring EAServer consultants to support its exploding EAServer business! Please submit your resume to ...

How to convert varchar data type into datetime data type without data lose
Hi all, i have stored date as varchar(30) data type and Date format is dd/MM/yyyy now i have to convert it into datatime data type can u help me in query ?  i have 330 records and each recod contain the Date in format of dd/MM/YYYY but due to varchar data type i can not perform calculation on Date so i have to convert into datetime without data lose. please help me in this regard. Best RegardsRameezWaheed  life is name of learning!Mark as an answer if it helps You can check these posts http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2039108&SiteID=17   ...

Web Method returning wrong data type
I have a Web Service on my local machine (written in VB.NET), with a web method that returns a custom, strongly-typed collection. When I create a VB.NET app and create the Web Service as a web reference, Intellisense doesn't show the method as returning the custom collection, but as the data type of the collection's default property. Am I doing something wrong on the web service side, or is this a visual studio thing?   I am experienced with VB.NET, but quite new to web services and SOAP. Thanks Hi, are you sure it's not an array of the collection item type? E.g if you return ...

The conversion of a char data type to a datetime data type!!
hello all .. I have a form that includes two textboxes (Date and Version) .. When I try to insert the record I get the following error message .. seems that something wrong with my coversion (Data type)"The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.The statement has been terminated."   in my SQL database I have the date feild as datetime and the version as nvarchar(max) this is the code in the vb page .. Can you please tell me how to solve this problem?Imports System.Data.SqlClient Imports system.web.configuration ...

Bit Data type column from Database to ASP Data grid getting error Cast from type 'DbDataRecord' to type 'Boolean' is not valid.
I have bit Datatype column in my table and I am putting this table into ASP datagrid  I have created a check box in thiscolumn in datagrid using itemtemplate.  so this bit column should have a check box next to it in datagrid but I am getting this when running the app  Cast from type 'DbDataRecord' to type 'Boolean' is not valid. any one know any thing about this issue Hi, khana04: I am not sure about what you are going to do about convert DbDataRecord to Boolean. Would u please show us some code about  it. However, the following code works fine for me to retrive t...

superreview granted: [Bug 248638] HTMLInputElement.type doesn't return the "type of control created" : [Attachment 151711] Always return the actual type
Peter Van der Beken <peterv@propagandism.org> has granted Johnny Stenback <jst@mozilla.jstenback.com>'s request for superreview: Bug 248638: HTMLInputElement.type doesn't return the "type of control created" http://bugzilla.mozilla.org/show_bug.cgi?id=248638 Attachment 151711: Always return the actual type http://bugzilla.mozilla.org/attachment.cgi?id=151711&action=edit ...

superreview requested: [Bug 248638] HTMLInputElement.type doesn't return the "type of control created" : [Attachment 151711] Always return the actual type
Johnny Stenback <jst@mozilla.jstenback.com> has asked Peter Van der Beken <peterv@propagandism.org> for superreview: Bug 248638: HTMLInputElement.type doesn't return the "type of control created" http://bugzilla.mozilla.org/show_bug.cgi?id=248638 Attachment 151711: Always return the actual type http://bugzilla.mozilla.org/attachment.cgi?id=151711&action=edit ...

Bug for data type : TwinControl(And several data types to other control)
I find that there is another oddity in the IDE. These irregularities can be found in Delphi Class Explorer. There are types of data that have not been handled properly. And this must be handled so as not to cause an error message that makes work uncomfortable. This got started when I was creating a package project. In this package, I created a new component. In the component I created it, I want to add property. For properties that have common data types like string, integer, double, boolean and some basic data types other no problem. The problem arises when I want to add the Parent...

The conversion of a char data type to a datetime data type resulted....
Hi, I'm trying to insert a date time value into a SQL Server Database field of type date time using a c# web form. I get the following error.... "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. The statement has been terminated" My SQL looks like this: INSERT INTO tblname (fldname) VALUES ('" + DateTime.Now.ToString() + "')" What am I doing wrong?"There is no such thing as a bug, just an unexpected feature." Remove the ToString() method as that is changing the DateTime type t...

Intercepting a data item and return it as a typed data
Hi, the table 'Contact' is being saved in 'db1.mdb' -------------------------------  Name  Address Age --------------------------------  David  High St. 21 Mary  West Road 19 John  East Ave 23 Susan South St 20 --------------------------------- and a method is needed to return a partiuclar piece of data based on the parameters provided by the caller, please have a look of the following lines to make the method works. Thx in advance.  public string getAddress(string args) { string result;OleDbConnecti...

System.Data.SqlClient.SqlException: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value
After clicking my update button I'm receiving this error:    The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. The statement has been terminated. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. The statement has been...

Size of string data type / column with char data type in PB
I use PB8 as front end with MS SQL Server database as back end. There is a column of Text data type in database. That column is able to hold large size of data. I created a datawindow to retrieve data from this column. Then I created a non-visual user object data store using this datawindow as dataobject. There is a multiplelineEdit control on a window which allows user to input pages of text. When the =91SAVE=92 button is clicked, the text should be saved into the table through the datastore. The problem is: the text is truncated after saving. Only about 4034 characters are ...

System.Data.SqlClient.SqlException: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
After testing out the application i write on the local pc. I deploy it to the webserver to test it out. I get this error. System.Data.SqlClient.SqlException: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. Notes: all pages that have this error either has a repeater or datagrid which load data when page loading. At first I thought the problem is with the date, but then I can see that some other pages that has datagrid ( that has a date field) work just fine. anyone having this problem before?? hopefully you guys can help...

The conversion of a char data type to a datetime data type resulted in an out-of-range ...
Hi,I couldn't understand why I canĀ“t convert the date. I use dd/mm/yyyy, and I put the correct sintax in my code: CType(tbVencimento.Text, Date)but it conti nues recording inside of my database like mm/dd/yyyy, why?and every moment I receive this error message:The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.The statement has been terminated.Please, help!Thanks a lot!Raphael Amador You should use DateTime.ParseExact to get the format changed.Dim s As Strings = "25/12/2005"Dim d As DateTimed = DateTime.ParseExact(s, "dd/MM/yyyy", Nothing...

Web resources about - TFDQuery Data Type returns wrong type - embarcadero.delphi.firedac

Resources last updated: 1/4/2016 9:22:35 PM