Page 1 of 1

[Solved] Selecting data from sql according to a define date

Posted: Mon Dec 17, 2007 6:24 pm
by spiritofgg
Help wanted :?:
I'm trying to extract fields from a table according to a date define by a field in a form with an sql statement on obase
Each time i try i obtain a "Wrong data type:java.lang.IllegalArgumentException". I think i've to transform one of the two number before my sql statement but how?
Anybody help ?
Thanks

Re: Comparistion of two number

Posted: Mon Dec 17, 2007 7:05 pm
by probe1
Please show us show code....

Re: Comparison of two number

Posted: Tue Dec 18, 2007 9:33 am
by spiritofgg
Sorry forgot the code :(

oControl is a date control

the code is
function AppelBase (req as String) as object
dim oContext as object
dim oSource as object
dim oInteractionHandler as object
dim oConnection as object
dim oRequete as object
dim oResultat as object
dim oDate as object
'dim req as string
dim res as string

oContext = createUnoService("com.sun.star.sdb.DatabaseContext")
oSource = oContext.getByName("sav")
oConnection=oSource.getconnection("","")
oRequete = oConnection.createStatement()
oResultat = oRequete.executeQuery(req)
AppelBase=oResultat
End Function

req="SELECT * FROM ""ANNIVERSAIRE"" where ""DATE"">'"+oControl.date"'"
oResult=AppelBase(req)