Welcome to Macrobject Community Login | Register | Faq  

    Macrobject Community
  Macrobject Software Knowledge Management and Collaboration Platform
Search    
   

DateTime fields in GROUP BY, manual relations and offline data
Started by vojko at 08-27-2007 1:43 PM. Topic has 1 replies.

Print Search « Previous Thread Next Thread »
  08-27-2007, 1:43 PM
vojko is not online. Last active: 8/28/2007 6:37:19 AM vojko

Top 100 Posts
Joined on 08-28-2007
Posts 1
DateTime fields in GROUP BY, manual relations and offline data
Reply Quote
Hi, 1. Is it possible to make OQL statements for DateTime fields, statements to extract grouped data like to get average per day over one month or similar. Here is an examples of MS SQL statement, where we get grouped records of sum,max,...., per ours: Also pay attention to DATEPART function .... 'SELECT DATEPART([YEAR], MyDateTimeFieldName') AS MyYEAR, DATEPART([MONTH], MyDateTimeFieldName') AS MyMONTH, DATEPART([DAY], MyDateTimeFieldName') AS MyDAY, DATEPART([HOUR], MyDateTimeFieldName') AS MyClock, COUNT(*) AS NumberOfGroupedRecords, SUM(FLD1) AS MySUM, MAX(FLD2) AS MyMAX, CASE TARIFA WHEN 1 THEN ''KT'' WHEN 2 THEN ''VT'' WHEN 3 THEN ''MT'' END AS MyTarifa FROM MYTABLE WHERE (DATEPART([YEAR], MyDateTimeFieldName') = '+CAST(@Leto AS char(4))+' ) AND (DATEPART([MONTH], MyDateTimeFieldName') = '+CAST(@Mesec AS char(2))+' ) AND (DATEPART([DAY], MyDateTimeFieldName') = '+CAST(@Dan AS char(2))+' ) GROUP BY DATEPART([YEAR], MyDateTimeFieldName'), DATEPART([MONTH], MyDateTimeFieldName'), DATEPART([DAY], MyDateTimeFieldName'), DATEPART([HOUR], MyDateTimeFieldName') , TARIFA ORDER BY MyClock 2. Wondering if it is possible to make manual relationship between tables. Many times we don't use DB's relations but make our own in the code. 3. What is the easiest way to make offline data ? To get ObjectDataSets and stream them to local files, XML or to local DB ? thank you, Kompozit EMRA d.o.o. Vojko Cendak,univ.dipl.ing.
   Report 
  08-27-2007, 7:44 PM
Wisdom is not online. Last active: 5/6/2009 7:06:03 PM Wisdom

Top 10 Posts
Joined on 07-25-2007
Posts 21
Re: DateTime fields in GROUP BY, manual relations and offline data
Reply Quote
1. Currently there is no function for DateTime.
The features about functions of DateTime will be added to our develop plan.

2. You can make manual relationship with editing the .xobject schema file.
Add some data to <ObjectSet Name="DoRelation"> and <ObjectSet Name="DoRelationField"> to make relationship manual.
We will add this feature to Macrobject CodeAuto.

3. You can use TXmlProvider to access a XML database.
Or you can use TXmlHelper for saving and loading ObjectSet or ObjectSpace.
Please take a look at "Macrobject.DObject.chm" for more information.


   Report 
Post
Macrobject Comm... » Developing Tool... » DObject O/R Map... » DateTime fields in GROUP BY, manual relations and offline data

Powered by Community Server, by Telligent Systems