Hi,
I made myself a view:
SELECT U.Id, EV.Id, SUM(Datediff(dd, StartDate, EndDate)
+ CASE WHEN Datepart(dw, StartDate) = 7 THEN 1 ELSE 0 END
- (Datediff(wk, StartDate, EndDate) * 2 )
- CASE WHEN Datepart(dw, StartDate) = 1 THEN 1 ELSE 0 END +
- CASE WHEN Datepart(dw, EndDate) = 1 THEN 1 ELSE -1 END +
- CASE WHEN EV.HalfDaysIncluded = 1 THEN 0.5 ELSE 0
END ) as days
from EmployerVacation as EV, [User] as U
where U.Id = EV.UserId and EV.UserId = 3
group by U.Id, EV.Id;
Now i did the stuff to add him to my llblgen project.
now my problem is that i can't seem to get my datasources working (from records outside my view)
(i want to add a full name from another table in there) (wich is not working atm)
the reason i don't really understand what is going wrong is the fact i can do the thing i am trying when i have multiple EntityTables wich are linked in the database trough <table_name>.<entity_name>
i got my Readercode here:
var filter = new PredicateExpression();
filter.AddWithAnd(EmployerVacationDayFields.UserId == EmployerFields.Id);
filter.AddWithAnd(EmployerVacationDayFields.Id == EmployerVacationFields.Id);
var relation = new RelationCollection();
relation.Add(EmployerVacationDayEntity.Relations.EmployerEntityUsingUserId);
var sorter = new SortExpression();
var employerVacation = new EmployerVacationDayCollection();
employerVacation.GetMulti(filter, -1, sorter, relation);
return employerVacation;
this bit gives an server error also:
filter.AddWithAnd(EmployerVacationDayFields.Id == EmployerVacationFields.Id);
i hope i am clear about it all
if not please ask in easy words cos i am a LLBLGen Noob
thanks for your help already
Sjoeii