In a need of data in between dates SQL + Java -
select sum(zetable) moneys socialnumber = '" + socialnumber + "' , identifier = '" + id + "' , salary in ('3333','3322','2222','2211') , startdate <= stardatesalary , (enddate >= enddatesalary or enddate null)
so problem while salaries correctly start date of salary. should looking start date of month trying salary from. illustration if salary goes june 16 july 16 , july 28 28. looking these salary gets me june july. , if july 1-31 july 1 31 info in 1 pile not work intended.
so kind of need end date of salary period , start date in between month looking info in in cutting june july salary @ 30 june , count 1-16july. , need separate cause else mess loads of things.
i hope clear this. been trying come solution in sql not quite sure how yet.
an easy way bring together result date dimension table (one contains 1 row per date). every row you'd show salary particular day (i.e. dividing total salary number of days salary period covering). grouping , sum new column.
easy :)
java sql date between
No comments:
Post a Comment