{"id":501,"date":"2008-01-04T19:03:00","date_gmt":"2008-01-05T02:03:00","guid":{"rendered":"http:\/\/members.crystalreportsbook.com\/crystal-reports-xi\/8-5-simple-data-types\/"},"modified":"2010-11-17T18:35:03","modified_gmt":"2010-11-18T01:35:03","slug":"8-5-simple-data-types","status":"publish","type":"post","link":"http:\/\/www.crystalreportsonlinetraining.com\/training\/8-5-simple-data-types\/","title":{"rendered":"8.05 Simple Data Types"},"content":{"rendered":"<h2>Simple Data Types<\/h2>\n<p>Basic syntax supports the standard simple data types that we expect in a language: Boolean, Number, Currency, String, DateTime, Date, and Time.<\/p>\n<p>Notice that rather than have a large number of numeric data types such as integer, double, etc., there is simply a single data type called Number. There is no need to worry about whether the number will use a decimal point or what its largest value is.<\/p>\n<p>The Currency data type is treated the same as a Number data type with a few exceptions. They are listed below:<\/p>\n<ul>\n<li>Currency can only have two decimal places. If assigned a number with more than two decimal places, it will round up to the nearest penny.<\/li>\n<li>Currency automatically gets formatted as a monetary value. This eliminates the overhead of always you having to format the variable whenever it gets printed.<\/li>\n<li>Since Currency is a different data type, it must be converted to a number to be used in mathematical assignments using non-currency variables. See the section &#8220;Converting Data Types&#8221; for more information.<\/li>\n<\/ul>\n<p>Strings use the double quote, &#8220;, to specify a string literal. A character is represented by a string of length one. Referencing a position within a string is Base 1. Thus, if you want to refer to the first character in a string, you would use an index of 1. The maximum length of a string constant is 65,534 characters. Information on using the Basic syntax built-in string functions is in the next chapter.<\/p>\n<p>         <code>\u2018Demonstrate assigning a string constant to a variable<\/code><br \/>\n         <code>Dim Var As String<\/code><br \/>\n         <code>Var = \"This is a string\"<\/code><\/p>\n<p>Dates are a little unusual in that there are three different data types available. The Date type can only store a date and the Time type can only store a time. It&#8217;s preferable to use these data types if you don&#8217;t need both values stored in a variable. If you do need both types in the same variable, use the DateTime type. Designate a DateTime constant by surrounding it with the # sign.<\/p>\n<p>         <code>Dim MyBirthday As DateTime<\/code><br \/>\n         <code>MyBirthday = #5\/23\/1968#<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Simple Data Types Basic syntax supports the standard simple data types that we expect in a language: Boolean, Number, Currency, String, DateTime, Date, and Time. Notice that rather than have a large number of numeric data types such as integer, double, etc., there is simply a single data type called Number. There is no need [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,2],"tags":[],"class_list":["post-501","post","type-post","status-publish","format-standard","hentry","category-chapter-8-programming-with-basic-syntax","category-crystal-reportsnet-2003","entry"],"_links":{"self":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts\/501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/comments?post=501"}],"version-history":[{"count":1,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts\/501\/revisions"}],"predecessor-version":[{"id":1575,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/posts\/501\/revisions\/1575"}],"wp:attachment":[{"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/media?parent=501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/categories?post=501"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.crystalreportsonlinetraining.com\/training\/wp-json\/wp\/v2\/tags?post=501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}