Click here to Skip to main content
11,478,066 members (72,023 online)
Rate this: bad
Please Sign up or sign in to vote.
I need to use this query in android sqlite , I'll pass CustomerNumber can any one help??

SELECT PromotionInfo.promotionnumber as NO,PromotionDesc as DESCRIPTION,CASE PromotionType WHEN '1' THEN 'AMOUNT' WHEN '2' THEN 'PERCENTAGE' WHEN '3' THEN 'Buy X Get Y free' WHEN '4' THEN 'Buy X Pay for Y' END as TYPE,PromotionValue as VALUE,FreeOrPayQuantity as FREEQTY FROM PromotionInfo, CustomerInfo, CustomerPromotionCalender where (getdate() between CustomerPromotionCalender.EffectiveStartDate and CustomerPromotionCalender.EffectiveEndDate) and (getdate() between PromotionInfo.Promo_Eff_StartDate and PromotionInfo.Promo_Eff_EndDate) and PromotionInfo.PromotionNumber = CustomerPromotionCalender.PromotionNumber and CustomerInfo.CustomerNumber = CustomerPromotionCalender.CustomerNumber and CustomerInfo.CustomerNumber ='" + CustomerNumber + "'"
Posted 10-Dec-12 2:33am
CHill60 at 10-Dec-12 8:33am
What is the error message that you get?
AndroidVivek at 11-Dec-12 0:25am
there is nothing like getDate()...

this query is basically for windows (uses mysql)
and i am doing in android (sqlite)
in windows to get current date there is function like getDate()..
but i don't get such kind of functionality in andorid(sqlite)
AndroidVivek at 11-Dec-12 0:54am
I dis one change and my query is now lil works

use datetime('now') instead getdate()..
thanks CHill60

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

its instead of getTime() use


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 194
1 Richard Deeming 180
2 OriginalGriff 160
3 Sascha Lefèvre 145
4 Tomas Takac 130
0 Sergey Alexandrovich Kryukov 7,675
1 OriginalGriff 7,256
2 Sascha Lefèvre 3,034
3 Maciej Los 2,491
4 Richard Deeming 2,305

Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 1 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100