{"id":294,"date":"2010-04-15T14:44:02","date_gmt":"2010-04-15T22:44:02","guid":{"rendered":"http:\/\/www.andreanolanusse.com\/en\/?p=294"},"modified":"2011-02-02T03:10:29","modified_gmt":"2011-02-02T11:10:29","slug":"using-records-to-avoid-problems-with-database-datetime-interval","status":"publish","type":"post","link":"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/","title":{"rendered":"Using Records to avoid problems with database date\/time interval"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-287\" style=\"border: 0pt none; margin: 4px;\" title=\"Delphi\" src=\"http:\/\/www.andreanolanusse.com\/en\/wp-content\/uploads\/2010\/03\/Icon_Delphi.png\" alt=\"\" width=\"175\" height=\"175\" \/>A record (analogous to a structure in some languages) represents a heterogeneous set of elements. Each element is called a field; the declaration of a record type specifies a name and type for each field.<br \/>\nThe record type became more powerful in Delphi 2006 by adding support for:<\/p>\n<ul>\n<li>Constructors<\/li>\n<li>Non-virtual methods<\/li>\n<li>Static methods and properties<\/li>\n<li>and more.<\/li>\n<\/ul>\n<p>Though records can now share much of the functionality of classes, there are  some important differences between classes and records.<\/p>\n<ul>\n<li>Records do not support inheritance.<\/li>\n<li>Records can contain variant parts; classes cannot.<\/li>\n<li>Records are value types, so they are copied on assignment, passed by value, and allocated on the stack unless they are declared globally or explicitly allocated using the New and Dispose function. Classes are reference types, so they are not copied on assignment, they are passed by reference, and they are allocated on the heap.<\/li>\n<li>For more, check your RAD Studio  <strong><a href=\"ms-help:\/\/embarcadero.rs2010\/rad\/Structured_Types.html#Records_.28traditional.29\" target=\"_blank\">documentation<\/a><\/strong>.<\/li>\n<\/ul>\n<p>Record can help us in many different situations, for example in case you need to represent a database primary key, we can use Record for that helping to easy understand and maintain the code. It&#8217;s true you don&#8217;t keep changing your primary keys very frequently, but some day if it became necessary, it will facilitate the necessary changes. Another situation is to use Record to represent data interval and I will talk about that in this post.<\/p>\n<p>Imagine the situation where you need to run a sales report filtered by period, and you have the follow method for that.<\/p>\n<pre class=\"brush: delphi\">    procedure GenerateReport( InitialDate, FinalDate : TDateTime );<\/pre>\n<p>During my trips visiting customers, many of them report a common problem when we talk about date interval, specially when is related with reports. The reason for this problem is because the DATE value on the DATE field includes TIME and the applications just set the Date for the interval.<\/p>\n<p>For many years the databases saved date and time on the same field, later they start to provide Data, Time and TimeStamp date types. Because the amount of data, systems and integration we can&#8217;t make update our database to represent this new data types, beside that those changes will impact many application. Considering we can&#8217;t make changes in our database, many of the Delphi Developers develop application to support more than one database, our application need to provide a mechanism to deal easily with this situation. We just need to make sure the date interval values will have &#8217;00:00:00&#8242; for the initial date and &#8217;23:59:59&#8242; final date, each database handle format for date\/time differently.<\/p>\n<p>Record is a excellent solution for this problem, instead to use two parameters for the method GenerateReport we will represent both as one Record and it will take care of the date\/time interval values, making easy to read, understand and maintain the code.<\/p>\n<p>The new method signature will change for::<\/p>\n<pre class=\"brush: delphi\">    procedure GenerateReport( Interval : TDateInterval );<\/pre>\n<p>The record structure will include the properties StartDate and FinalDate, the Set methods will adjust the time value for both dates.<\/p>\n<p>Below the record declaration.<\/p>\n<pre class=\"brush: delphi\">unit Interval;\r\n\r\ninterface\r\n\r\nuses SysUtils, DateUtils;\r\n\r\ntype\r\n\r\n  TDateInterval = Record\r\n  private\r\n    FFinalDate: TDateTime;\r\n    FStartDate: TDateTime;\r\n    procedure SetFinalDate(const Value: TDateTime);\r\n    procedure SetStartDate(const Value: TDateTime);\r\n\r\n  public\r\n    property StartDate: TDateTime read FStartDate write SetStartDate;\r\n    property FinalDate: TDateTime read FFinalDate write SetFinalDate;\r\n\r\n    Constructor Create(Id, Fd: TDateTime);\r\n\r\n    procedure SetAnnualInterval( Iy, Fy : Integer );\r\n  end;\r\n\r\nimplementation\r\n\r\n{ TDateInterval }\r\n\r\nconstructor TDateInterval.Create(SYear, FYear: TDateTime);\r\nbegin\r\n  StartDate := SYear;\r\n  FinalDate := FYear;\r\nend;\r\n\r\nprocedure TDateInterval.SetFinalDate(const Value: TDateTime);\r\nbegin\r\n  FFinalDate := EncodeDateTime(Yearof(Value), MonthOf(Value), Dayof(Value), 23, 59, 59, 999);\r\nend;\r\n\r\nprocedure TDateInterval.SetStartDate(const Value: TDateTime);\r\nbegin\r\n  FStartDate := EncodeDateTime(Yearof(Value), MonthOf(Value), Dayof(Value), 0, 0, 0, 0);\r\nend;\r\n\r\nprocedure TDateInterval.SetAnnualInterval(SYear, FYear: Integer);\r\nbegin\r\n  StartDate := EncodeDate(SYear, 1, 1);\r\n  FinalDate := EncodeDate(FYear, 12, 31);\r\nend;\r\n\r\nend.<\/pre>\n<ul>\n<li>Any changes on StartDate and FinalDate properties will be adjusted to represent the correct time values<\/li>\n<li>There is a additional method named SetAnnualInterval, where you pass the period of years you would like for the reports, instead of the complete dates.<\/li>\n<\/ul>\n<p>The sample below shows how you can use this Record to present the interval;<\/p>\n<pre class=\"brush: delphi\">var\r\n  interval: TDateInterval;\r\nbegin\r\n  interval.StartDate := EncodeDate( 2009, 1, 1);\r\n  interval.FinalDate := Now;\r\n\r\n  GenerateReport(interval);<\/pre>\n<p>Another way is to pass the interval using the Record constructor.<\/p>\n<pre class=\"brush: delphi\">var\r\n  interval: TDateInterval;\r\nbegin\r\n  interval.Create(EncodeDate( 2009, 1, 1), Now);\r\n  GenerateReport(interval);<\/pre>\n<p>Also you can use the method SetAnnualInterval, where you specify a annual interval.<\/p>\n<pre class=\"brush: delphi\">var\r\n  interval : TDateInterval;\r\nbegin\r\n\r\n  interval.SetAnnualInterval(2008, 2009);\r\n\r\n  GenerateReport(interval);<\/pre>\n<p>In all cases the time was adjusted by the Set Methods,<\/p>\n<p>We can add another features in this record, why note ask for the record to create the SQL where clause? Just two additional methods will provide that for us.<\/p>\n<p>DBDateFormat formats the date and time values to add on the where clause. If the database uses different format, which I&#8217;m not representing the date\/time format for every database on the following code, but after you read this post, you can download the source code and make the changes necessary to represent the database format. An additional parameter could be enough for this method, you can pass the SQL Connection for example and look at the driver property to identify how to format the date\/time values. In this sample I don&#8217;t use parameter, but you can update the code later.<\/p>\n<p>The method GenerateSQL has the Field parameter, which represents the table field.<\/p>\n<pre class=\"brush: delphi\">function TDateInterval.DBDateFormat(const Value: TDateTime): String;\r\nbegin\r\n  Result := FormatDateTime('mm\/dd\/yyyy hh:mm:ss', Value);\r\nend;\r\n\r\nfunction TDateInterval.GenerateSQL(Field: String): String;\r\nConst\r\n  sql: String = '%s between ''%s'' and ''%s'' ';\r\nbegin\r\n  Result := Format(sql, [Field, DataDBFormat(StartDate), DataDBFormat(FinalDate)]);\r\nend;<\/pre>\n<p>You use both method like this:<\/p>\n<pre class=\"brush: delphi\">var\r\n  period : TDateInterval;\r\nbegin\r\n\r\n  period.SetAnnualInterval(2008, 2009);\r\n\r\n  ShowMessage( period.GenerateSQL('DATE_FIELD'));<\/pre>\n<p>The ShowMessage will show  <strong>DATE_FIELD between &#8217;01\/01\/2008 00:00:00&#8242; and &#8217;12\/31\/2009 23:59:59&#8242;<\/strong><\/p>\n<p>I hope this visualizes another way to use Record, and that you find the date interval example useful. It can of course be implemented in many different ways, this is just one which I use to help in my explanation about Records.<\/p>\n<p>You can download the source code <a href=\"http:\/\/www.andreanolanusse.com\/en\/wp-content\/uploads\/2010\/04\/Interval.zip\"><strong>here<\/strong><\/a><\/p>\n<div id=\"_mcePaste\" style=\"overflow: hidden; position: absolute; left: -10000px; top: 723px; width: 1px; height: 1px;\">\n<pre class=\"brush: delphi\">TDateInterval<\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>A record (analogous to a structure in some languages) represents a heterogeneous set of elements. Each element is called a field; the declaration of a record type specifies a name and type for each field. The record type became more powerful in Delphi 2006 by adding support for: Constructors Non-virtual methods Static methods and properties [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_s2mail":"","footnotes":""},"categories":[10],"tags":[90,52],"class_list":["post-294","post","type-post","status-publish","format-standard","hentry","category-delphi","tag-delphi","tag-records"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Using Records to avoid problems with database date\/time interval | Andreano Lanusse | Technology and Software Development<\/title>\n<meta name=\"description\" content=\"A record (analogous to a structure in some languages) represents a heterogeneous set of elements. Each element is called a field; the declaration of a\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using Records to avoid problems with database date\/time interval | Andreano Lanusse | Technology and Software Development\" \/>\n<meta property=\"og:description\" content=\"A record (analogous to a structure in some languages) represents a heterogeneous set of elements. Each element is called a field; the declaration of a\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/\" \/>\n<meta property=\"og:site_name\" content=\"Andreano Lanusse | Technology and Software Development\" \/>\n<meta property=\"article:published_time\" content=\"2010-04-15T22:44:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2011-02-02T11:10:29+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.andreanolanusse.com\/en\/wp-content\/uploads\/2010\/03\/Icon_Delphi.png\" \/>\n<meta name=\"author\" content=\"Andreano Lanusse\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andreano Lanusse\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/\"},\"author\":{\"name\":\"Andreano Lanusse\",\"@id\":\"https:\/\/www.andreanolanusse.com\/en\/#\/schema\/person\/b51fdf99c01fcd6ae0a5ae894c23837b\"},\"headline\":\"Using Records to avoid problems with database date\/time interval\",\"datePublished\":\"2010-04-15T22:44:02+00:00\",\"dateModified\":\"2011-02-02T11:10:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/\"},\"wordCount\":800,\"commentCount\":9,\"publisher\":{\"@id\":\"https:\/\/www.andreanolanusse.com\/en\/#\/schema\/person\/b51fdf99c01fcd6ae0a5ae894c23837b\"},\"image\":{\"@id\":\"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.andreanolanusse.com\/en\/wp-content\/uploads\/2010\/03\/Icon_Delphi.png\",\"keywords\":[\"Delphi\",\"Records\"],\"articleSection\":[\"Delphi\"],\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/\",\"url\":\"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/\",\"name\":\"Using Records to avoid problems with database date\/time interval | Andreano Lanusse | Technology and Software Development\",\"isPartOf\":{\"@id\":\"https:\/\/www.andreanolanusse.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.andreanolanusse.com\/en\/wp-content\/uploads\/2010\/03\/Icon_Delphi.png\",\"datePublished\":\"2010-04-15T22:44:02+00:00\",\"dateModified\":\"2011-02-02T11:10:29+00:00\",\"description\":\"A record (analogous to a structure in some languages) represents a heterogeneous set of elements. Each element is called a field; the declaration of a\",\"breadcrumb\":{\"@id\":\"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/#primaryimage\",\"url\":\"http:\/\/www.andreanolanusse.com\/en\/wp-content\/uploads\/2010\/03\/Icon_Delphi.png\",\"contentUrl\":\"http:\/\/www.andreanolanusse.com\/en\/wp-content\/uploads\/2010\/03\/Icon_Delphi.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.andreanolanusse.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using Records to avoid problems with database date\/time interval\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.andreanolanusse.com\/en\/#website\",\"url\":\"https:\/\/www.andreanolanusse.com\/en\/\",\"name\":\"Andreano Lanusse | Technology and Software Development\",\"description\":\"Where Andreano Lanusse talk about technology, software development, programming techniques, databases, games and more through articles, tutorials and videos\",\"publisher\":{\"@id\":\"https:\/\/www.andreanolanusse.com\/en\/#\/schema\/person\/b51fdf99c01fcd6ae0a5ae894c23837b\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.andreanolanusse.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.andreanolanusse.com\/en\/#\/schema\/person\/b51fdf99c01fcd6ae0a5ae894c23837b\",\"name\":\"Andreano Lanusse\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/www.andreanolanusse.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/49ab23ef70c249c0cb3469f14ef07edc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/49ab23ef70c249c0cb3469f14ef07edc?s=96&d=mm&r=g\",\"caption\":\"Andreano Lanusse\"},\"logo\":{\"@id\":\"https:\/\/www.andreanolanusse.com\/en\/#\/schema\/person\/image\/\"},\"description\":\"Andreano Lanusse is an expert and enthusiastic on software development industry, at Embarcadero he is focused on helping to make sure the products being developed meet the expectations of Embarcadero's customers, as well as defining market strategies for Latin America. Today as Latin Lead Evangelist he spends great deal of time in developer conferences, tradeshows, user group, and visiting customers throughout Latin America. Before Embarcadero, he worked 13 years for Borland, Andreano has worked as Support Coordinator, Engineer, Product Manager, including Product Line Sales Manager, where was responsible to manage the relationship with Brazil developer community, also has worked as Principal Consultant for Borland Consulting Services on the development and management of critical applications. He previously served as Chief Architect for USS Solu\u00e7\u00f5es Gerenciadas (now USS Tempo). Andreano holds a bachelor's degree in Business Administration Marketing Emphasis from Sumare Institute, MBA in Project Management from FGV, certification in Microsoft products, all Borland ALM products, and all CodeGear product line.\",\"sameAs\":[\"http:\/\/www.andreanolanusse.com\",\"https:\/\/x.com\/andreanolanusse\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using Records to avoid problems with database date\/time interval | Andreano Lanusse | Technology and Software Development","description":"A record (analogous to a structure in some languages) represents a heterogeneous set of elements. Each element is called a field; the declaration of a","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/","og_locale":"en_US","og_type":"article","og_title":"Using Records to avoid problems with database date\/time interval | Andreano Lanusse | Technology and Software Development","og_description":"A record (analogous to a structure in some languages) represents a heterogeneous set of elements. Each element is called a field; the declaration of a","og_url":"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/","og_site_name":"Andreano Lanusse | Technology and Software Development","article_published_time":"2010-04-15T22:44:02+00:00","article_modified_time":"2011-02-02T11:10:29+00:00","og_image":[{"url":"http:\/\/www.andreanolanusse.com\/en\/wp-content\/uploads\/2010\/03\/Icon_Delphi.png","type":"","width":"","height":""}],"author":"Andreano Lanusse","twitter_misc":{"Written by":"Andreano Lanusse","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/#article","isPartOf":{"@id":"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/"},"author":{"name":"Andreano Lanusse","@id":"https:\/\/www.andreanolanusse.com\/en\/#\/schema\/person\/b51fdf99c01fcd6ae0a5ae894c23837b"},"headline":"Using Records to avoid problems with database date\/time interval","datePublished":"2010-04-15T22:44:02+00:00","dateModified":"2011-02-02T11:10:29+00:00","mainEntityOfPage":{"@id":"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/"},"wordCount":800,"commentCount":9,"publisher":{"@id":"https:\/\/www.andreanolanusse.com\/en\/#\/schema\/person\/b51fdf99c01fcd6ae0a5ae894c23837b"},"image":{"@id":"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/#primaryimage"},"thumbnailUrl":"http:\/\/www.andreanolanusse.com\/en\/wp-content\/uploads\/2010\/03\/Icon_Delphi.png","keywords":["Delphi","Records"],"articleSection":["Delphi"],"inLanguage":"en","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/","url":"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/","name":"Using Records to avoid problems with database date\/time interval | Andreano Lanusse | Technology and Software Development","isPartOf":{"@id":"https:\/\/www.andreanolanusse.com\/en\/#website"},"primaryImageOfPage":{"@id":"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/#primaryimage"},"image":{"@id":"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/#primaryimage"},"thumbnailUrl":"http:\/\/www.andreanolanusse.com\/en\/wp-content\/uploads\/2010\/03\/Icon_Delphi.png","datePublished":"2010-04-15T22:44:02+00:00","dateModified":"2011-02-02T11:10:29+00:00","description":"A record (analogous to a structure in some languages) represents a heterogeneous set of elements. Each element is called a field; the declaration of a","breadcrumb":{"@id":"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/#primaryimage","url":"http:\/\/www.andreanolanusse.com\/en\/wp-content\/uploads\/2010\/03\/Icon_Delphi.png","contentUrl":"http:\/\/www.andreanolanusse.com\/en\/wp-content\/uploads\/2010\/03\/Icon_Delphi.png"},{"@type":"BreadcrumbList","@id":"http:\/\/www.andreanolanusse.com\/en\/using-records-to-avoid-problems-with-database-datetime-interval\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.andreanolanusse.com\/en\/"},{"@type":"ListItem","position":2,"name":"Using Records to avoid problems with database date\/time interval"}]},{"@type":"WebSite","@id":"https:\/\/www.andreanolanusse.com\/en\/#website","url":"https:\/\/www.andreanolanusse.com\/en\/","name":"Andreano Lanusse | Technology and Software Development","description":"Where Andreano Lanusse talk about technology, software development, programming techniques, databases, games and more through articles, tutorials and videos","publisher":{"@id":"https:\/\/www.andreanolanusse.com\/en\/#\/schema\/person\/b51fdf99c01fcd6ae0a5ae894c23837b"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.andreanolanusse.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":["Person","Organization"],"@id":"https:\/\/www.andreanolanusse.com\/en\/#\/schema\/person\/b51fdf99c01fcd6ae0a5ae894c23837b","name":"Andreano Lanusse","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/www.andreanolanusse.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/49ab23ef70c249c0cb3469f14ef07edc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/49ab23ef70c249c0cb3469f14ef07edc?s=96&d=mm&r=g","caption":"Andreano Lanusse"},"logo":{"@id":"https:\/\/www.andreanolanusse.com\/en\/#\/schema\/person\/image\/"},"description":"Andreano Lanusse is an expert and enthusiastic on software development industry, at Embarcadero he is focused on helping to make sure the products being developed meet the expectations of Embarcadero's customers, as well as defining market strategies for Latin America. Today as Latin Lead Evangelist he spends great deal of time in developer conferences, tradeshows, user group, and visiting customers throughout Latin America. Before Embarcadero, he worked 13 years for Borland, Andreano has worked as Support Coordinator, Engineer, Product Manager, including Product Line Sales Manager, where was responsible to manage the relationship with Brazil developer community, also has worked as Principal Consultant for Borland Consulting Services on the development and management of critical applications. He previously served as Chief Architect for USS Solu\u00e7\u00f5es Gerenciadas (now USS Tempo). Andreano holds a bachelor's degree in Business Administration Marketing Emphasis from Sumare Institute, MBA in Project Management from FGV, certification in Microsoft products, all Borland ALM products, and all CodeGear product line.","sameAs":["http:\/\/www.andreanolanusse.com","https:\/\/x.com\/andreanolanusse"]}]}},"_links":{"self":[{"href":"http:\/\/www.andreanolanusse.com\/en\/wp-json\/wp\/v2\/posts\/294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.andreanolanusse.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.andreanolanusse.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.andreanolanusse.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.andreanolanusse.com\/en\/wp-json\/wp\/v2\/comments?post=294"}],"version-history":[{"count":0,"href":"http:\/\/www.andreanolanusse.com\/en\/wp-json\/wp\/v2\/posts\/294\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.andreanolanusse.com\/en\/wp-json\/wp\/v2\/media?parent=294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.andreanolanusse.com\/en\/wp-json\/wp\/v2\/categories?post=294"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.andreanolanusse.com\/en\/wp-json\/wp\/v2\/tags?post=294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}