Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

months between dates [CORE2206] #2634

Closed
firebird-automations opened this issue Nov 20, 2008 · 3 comments
Closed

months between dates [CORE2206] #2634

firebird-automations opened this issue Nov 20, 2008 · 3 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: carolina alzate (pfalzate)

I need to find the number of months between 2 dates, using firebird-2.x, a UDF to do this, but always returns to annex as a result 0

dll code in delphi

library CAO_UDFS;
uses
SysUtils,
Classes,
Controls,
DateUtils;
{$R *.res}

function MesesEntreFechas(Fecha1,Fecha2: TDate): Integer; cdecl;
begin
Result := MonthsBetween(Fecha1,Fecha2);
end;

exports
MesesEntreFechas;
begin
end.

register udf en firebird

DECLARE EXTERNAL FUNCTION MESESENTREFECHAS
DATE,
DATE
RETURNS INTEGER BY VALUE
ENTRY_POINT 'MesesEntreFechas' MODULE_NAME 'CAO_UDFs.dll';

Always always returns zero when using MesesEntreFechas

I can help someone who is ill.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Firebird's date is not compatible with Delphi's TDate. You should using other datatypes in your UDF.

What you need is available in FB 2.1: search the release notes for the DATEDIFF function.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant