On Thu, 2015-03-19 at 15:15 -0700, xavier2 wrote: > Hello > I need to insert the current date from my computer into a field from a > database. > SQL has a function called NOW() which introduce the current date into a > field. However, I don't know very well how this work. I tried to visit a > website giving code examples in SQL... w3schools.com however I find > differences between the SQL language posted in that website and the SQL > language used in LibreOffice Base > > For example, at w3schools.com they would suggest me this code to introduce > the current system date and hour into a field of my database (sorry for the > fields are in Spanish)... > > SELECT > ID_Empleados, > Nombre, > Apellido1ero, > Direccion, > > NOW( ) > PerDate > > FROM > tbl_EMPLEADOS > > Okay, that code will fail in LibreOffice Base, and it is SQL ... > > ??? > > However, if I use " " then the code work...
I am new to sql myself but, I believe that base auto converts all sql code into capitals letters. If you used all capitals for the columns in your table, then you should be fine, else you must define the string literals with surrounding double quotes. "" > This code will work in LibreOffice Base... > > SELECT > "ID_Empleados", > "Nombre", > "Apellido1ero", > "Direccion", > > NOW( ) > "PerDate" > > FROM > "tbl_EMPLEADOS" > > As you may see, the code is exactly the same except that LibreOffice Base > SQL need quotation marks " " to define the name of fields and tables... > > So I was wondering if the SQL from LibreOffice Base change very much from > the original SQL and if we have more notation changes... > > ??? -- To unsubscribe e-mail to: [email protected] Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted
