Mysql/Mariadb Effect date (Mr. Rao)

Mysql/Mariadb Effect date (Mr. Rao)

Postby dagiayunus » Sat Jun 24, 2017 10:41 pm

Dear Sir Mr.Rao

How we can set and use effective dates with mysql/mariadb for example

Item A Price 60 Rs from Dt.20/06/2017
Item A Price 80 Rs from Dt.24/06/2017


Thanks & Regards
Dagia Yunus.
Rajkot, India

FWH 17.04
dagiayunus
 
Posts: 69
Joined: Wed Nov 19, 2014 1:04 pm

Re: Mysql/Mariadb Effect date (Mr. Rao)

Postby nageswaragunupudi » Sun Jun 25, 2017 3:53 am

Code: Select all  Expand view
function GetPrice( cItemID, dDate )

   local cSql

   cSql  := "SELECT date,price FROM prices WHERE itemid = ? AND IFNULL( date, '0000-00-00' ) <= ? ORDER BY date DESC LIMIT 1"
   cSql  := oCn:ApplyParams( cSql, { cItemID, dDate } )

return oCn:QueryResult( cSql )[ 2 ]

 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10242
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 20 guests