Compare to dates

Compare to dates

Postby Øyvind » Tue 02 Feb 2016 14:38

I have a date compare problem:

In T-SQL I have this solution:
Select * from MyTable where convert(Date,ADay,104) = convert(Date,@Mydate,104)
Whats happends is that 104 changes the date to the same date formats.

What is best pactice in a DevArt Oracle environment ?
Øyvind
 
Posts: 2
Joined: Tue 02 Feb 2016 13:53

Re: Compare to dates

Postby Øyvind » Tue 02 Feb 2016 14:58

Solution:

Select * from MyTable to_char(SHIP_BY_DATE, 'DD-MON-YY') = to_char(:ShipByDate, 'DD-MON-YY')
Command.Parameters.Add("ShipByDate", Dato)

http://stackoverflow.com/questions/10178292/comparing-dates-in-oracle-sql
Øyvind
 
Posts: 2
Joined: Tue 02 Feb 2016 13:53


Return to dotConnect for Oracle