Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » data set with field date ?
data set with field date ? [message #1789876] Thu, 31 May 2018 09:13 Go to next message
mim Awnaf is currently offline mim AwnafFriend
Messages: 6
Registered: May 2018
Junior Member
i need to execute this request :
select *
from user
where date_creation >=? and date_creation <=?

i created 2 string params
when i execute report, i write this date 2018-03-01 and 2018-03-12
the result is null
but when i modify the request like this :
select *
from user
where date_creation >='2018-03-01' and date_creation <='2018-03-12'

it works
what is the problem ?
Re: data set with field date ? [message #1789991 is a reply to message #1789876] Fri, 01 June 2018 17:17 Go to previous messageGo to next message
Eric Davis is currently offline Eric DavisFriend
Messages: 9
Registered: March 2018
Junior Member
Check the parameter data type.
Re: data set with field date ? [message #1790018 is a reply to message #1789991] Sun, 03 June 2018 07:23 Go to previous messageGo to next message
mim Awnaf is currently offline mim AwnafFriend
Messages: 6
Registered: May 2018
Junior Member
thanks for your message
it doesn't work if parameter is string also date type i try it
Re: data set with field date ? [message #1790027 is a reply to message #1790018] Sun, 03 June 2018 15:27 Go to previous messageGo to next message
Colin Sutton is currently offline Colin SuttonFriend
Messages: 104
Registered: July 2009
Senior Member
Your query "select *
from user
where date_creation >='2018-03-01' and date_creation <='2018-03-12'"
is comparing strings and works by chance of string comparison.

To compare dates you need date types,, e.g.
select *
from user
where to date_creation between to_date('2018-03-01' ,'YYYY-MM-DD') and to_date('2018-03-12','YYYY-MM-DD')

assuming date_creation is a date, not a string.

[Updated on: Sun, 03 June 2018 15:28]

Report message to a moderator

Re: data set with field date ? [message #1790042 is a reply to message #1790027] Mon, 04 June 2018 06:14 Go to previous messageGo to next message
mim Awnaf is currently offline mim AwnafFriend
Messages: 6
Registered: May 2018
Junior Member
hi,
thank you
it doesn't work
i simplified my exemple just to :
date_creation= str_to_date(?, '%Y-%m-%d')

Re: data set with field date ? [message #1790058 is a reply to message #1790042] Mon, 04 June 2018 10:13 Go to previous message
mim Awnaf is currently offline mim AwnafFriend
Messages: 6
Registered: May 2018
Junior Member
i resolved the problem by deleting the table that receives the result then i created the new table with the same data set
the problem is in eclipse it doesn't update and take in consideration the modifications n datasets
Previous Topic:SEVERE: Cannot process data source extension configuration.
Next Topic:Passing Maximo where clause
Goto Forum:
  


Current Time: Sun Nov 18 09:43:18 GMT 2018

Powered by FUDForum. Page generated in 0.02529 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top