Bug 28492 - Message "no such function: adddays"
Summary: Message "no such function: adddays"
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: master
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-03-27 08:45 UTC by Michelangelo
Modified: 2016-05-27 13:25 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Michelangelo 2015-03-27 08:45:24 UTC
When I try to add Days to diatomite.now I have this message.

My code:
DateTime.Now.AddDays(1d)).ToList();

I had tried also:
DateTime.Now.AddDays(1)).ToList();
DateTime.Now.AddDays(1f)).ToList();

with same error message.

ex	{SQLite.SQLiteException: no such function: adddays   at SQLite.SQLite3.Prepare2 (IntPtr db, System.String query) [0x00000] in <filename unknown>:0    at SQLite.SQLiteCommand.Prepare () [0x00000] in <filename unknown>:0    at SQLite.SQLiteCommand+<ExecuteDeferredQuery>c__Iterator0`1[XXX].MoveNext () [0x00000] in <filename unknown>:0    at .....
......
SQLite.SQLiteException
Comment 1 Michelangelo 2015-03-30 04:39:34 UTC
I found a trick to resolve....

Put in a variable, like this:

DateTime DayFilter;

DayFilter = DateTime.Now.AddDays(2);

and then use DayFilter variable:

l.DateEvent < DayFilter).ToList();
Comment 2 Sebastien Pouliot 2015-03-30 09:55:18 UTC
DateTime.Now.AddDays(1d)).ToList();

^ that can't compile, there's an extra ')'. Also that looks unrelated to SQLite which is where the exception comes from.

Can you attach a self-contained test case ?

and all the software version being used locally* and the iOS version(s), simulator or devices, used.

* The easiest way to get exact version information is to use the "Xamarin Studio" menu, "About Xamarin Studio" item, "Show Details" button and copy/paste the version informations (you can use the "Copy Information" button).
Comment 4 Rolf Bjarne Kvinge [MSFT] 2015-03-31 05:27:26 UTC
That code is still not enough for us to reproduce the problem.

Can you attach a complete solution we can run to see this ourselves?
Comment 5 Michelangelo 2015-04-03 08:48:07 UTC
I resolved. 

Problem is DateFormat c# comparison with SQLite DateFormat.

I have to format date like this: 

DateTime Today = DateTime.Today;

and then:

Exec (c => {
        result = c.Table<Lancio>().Where( l => l.DateEvent <
Today.ToShortDateString()).ToList();
Comment 6 Sebastien Pouliot 2015-04-06 08:47:40 UTC
It's still not clear what code / library you were using when you had an issue (there's many providers for SQLite).

You might close the bug if the issue was limited to your own code (or libraries not shipped with XI) but the status cannot be changed to IN_PROGRESS if no one from Xamarin is working on it.
Comment 7 Sebastien Pouliot 2016-05-27 13:25:17 UTC
We have never been able to reproduce this.

If you are still experiencing this issue please provide all the requested information and re-open the bug report. Thanks!