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

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
User avatar
spiritofgg
Posts: 6
Joined: Thu Dec 06, 2007 5:42 pm

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

Post 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
Last edited by spiritofgg on Wed Dec 19, 2007 2:39 pm, edited 6 times in total.
User avatar
probe1
Volunteer
Posts: 277
Joined: Mon Oct 08, 2007 1:34 am
Location: Chonburi Thailand

Re: Comparistion of two number

Post by probe1 »

Please show us show code....
Cheers
Winfried

DateTime2 extension: insert date, time or timestamp, formatted to your needs
User avatar
spiritofgg
Posts: 6
Joined: Thu Dec 06, 2007 5:42 pm

Re: Comparison of two number

Post 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)
Post Reply