Select dates which go after current.

Hello Everyone,

I have the problem with select of my data:

I try simple aggregate

SyntaxEditor Code Snippet

TestDates.StartDate>CurrDateTime()

and it return one row but I expect more. Opposite works fine. 

Also I tried make SQL 

SyntaxEditor Code Snippet

SELECT {TestDates}.* from {TestDates} where {TestDates}.[StartDate]>@localcur

where @localcur=CurrDateTime() and have error "Invalid cast from 'Int32' to 'DateTime'

Solution

Hi,

  • First of all in your DataTimeTestData module you have an unwanted dependency to theme of DataTimeTestWeb module.This creates a circular dependency.
  • Second your attributes are called StartDate and EndDate but datatype is DateTime, this is confusing,
    my first thoughts when looking at your post was you where comparing a date with datetime.
  • Third i think it is correct one record is returned:

This is the date sorted decending on Startdate:

Today is 2019-08-16 and it is past 5:00:00,

 so only the first record should be returned.

Regards,

Daniel

Solution

Daniël Kuhlmann wrote:

Hi,

  • First of all in your DataTimeTestData module you have an unwanted dependency to theme of DataTimeTestWeb module.This creates a circular dependency.
  • Second your attributes are called StartDate and EndDate but datatype is DateTime, this is confusing,
    my first thoughts when looking at your post was you where comparing a date with datetime.
  • Third i think it is correct one record is returned:

This is the date sorted decending on Startdate:

Today is 2019-08-16 and it is past 5:00:00,

 so only the first record should be returned.

Regards,

Daniel

Hi Daniel,

Thank you for answer. Yes this is my foal...

I made wrong select. I need 17.08, 18.08 and etc.