1

Hi

I'm implementing a plug-in for FogBugz. I want to sum the amount of time spend on a bug. I need to do it with an sql request (because in real world, i would like to do it beetween two dates and with other where clauses too). The problem I have, is that it seems that the MySQL built-in functions TIMEDIFF and TIME_TO_SEC raise an error : Unknown function: TIME_TO_SEC

Here's the code :

 CSelectQuery qryStats = api.Database.NewSelectQuery("TimeInterval");
 qryStats.IgnorePermissions = true;
 qryStats.AddSelect("Bug.ixBug, sum(TIME_TO_SEC(TIMEDIFF(dtend, dtstart)))");
 qryStats.AddGroupBy("Bug.ixBug");

Is there a way to access the built-in functions of MySql while using FB API ?

Regards Julien

flag

1 Answer

2

The API was written to be as cross platform as possible with respect to the database so there are a very limited number of DB functions allowed by the query API.

There is an article in the Developer Wiki that enumerates all the DB functions allowed: Allowed Built-In SQL Functions

link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.