Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.

create variable aDate date;
create variable aTime time;
create variable aDateTime Datetime;

set aDate = current date;
set aTime = current time;
set aDateTime = aDate + aTime;

select aDate, aTime, aDateTime, *
from *remoteTable*

The propery aDateTime wil show the correct date time, but if you add aDate+aTime the system will give an error. This is because the space is removed between the date and time.

Is this the expected behaviour or a bug?

asked 26 May '21, 09:04

Frank%20Vestjens's gravatar image

Frank Vestjens
1.3k374866
accept rate: 20%

What remote DBMS are you using? When using proxy tables on MS SQL, querying for dates still fails for me, see here...

(26 May '21, 09:21) Volker Barth

I have tried this with a proxy table for SQLA Demo Departments table and the following:

   create or replace variable aDate date;
   create or replace variable aTime time;
   create or replace variable aDateTime Datetime;

   set aDate = current date;
   set aTime = current time;
   set aDateTime = aDate + aTime;

  select 
     @@version, 
     aDate, aTime, aDateTime, 
    aDate + aTime, * 
  from departments 
  where DepartmentID = 100;

I get no errors.

It would helpful to know the remote server type and the specific error that is being reported.

(26 May '21, 14:55) Chris Keating
Comment Text Removed
Comment Text Removed
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×29
×25

question asked: 26 May '21, 09:04

question was seen: 773 times

last updated: 27 May '21, 02:27