Re: Query For Dynamic View.. (282 Views)
Reply
Regular Advisor
Posts: 106
Registered: ‎09-10-2013
Message 1 of 6 (291 Views)
Accepted Solution

Query For Dynamic View..

Hi All

 

I have a requirement were as to create a new view between 2 dates for fields open.time.

 

Opened before field:  shoud take the value tod() but in the format eg 16/12/13 00:00:00

 

Open by filed : shoud take the value tod() but in the format eg 16/12/13 00:00:00- 7 00:00:00

 

Can someone guide me to write thh normalized query for the same ...

 

Regards

AA

Honored Contributor
Posts: 5,881
Registered: ‎11-10-2008
Message 2 of 6 (288 Views)

Re: Query For Dynamic View..

Hello,

before implementing that i have to tell you that any such operations in query of view make a big load on system and might afffect the speed.

 

16/12/13 00:00:00 can be achieved by date(tod())

16/12/13 00:00:00- 7 00:00:00 can be achieved by date(tod())-'7 00:00:00'

 

I have not tested it in my environment but we have previously done such queries.

Regular Advisor
Posts: 106
Registered: ‎09-10-2013
Message 3 of 6 (285 Views)

Re: Query For Dynamic View..

Hi Vadim

 

Thanks for the response ... However if I use tod() it takes the format as current time and current date .. I need the format as current date and time as 00:00:00.

 

Yes , I am aware of the implication, I will be testing the same in my test environment..

Honored Contributor
Posts: 5,881
Registered: ‎11-10-2008
Message 4 of 6 (282 Views)

Re: Query For Dynamic View..

Hello,

if you will look at the expression which i posted, you will see that I am not using direclty tod() but date(tod()).

 

 

In this case date() operator is taking the date from current time and adds 00:00:00 to it.

Regular Advisor
Posts: 106
Registered: ‎09-10-2013
Message 5 of 6 (267 Views)

Re: Query For Dynamic View..

Hi Vadim

 

All works fine .. Thank you so much .. Greatly Appreciated ..

Honored Contributor
Posts: 5,881
Registered: ‎11-10-2008
Message 6 of 6 (264 Views)

Re: Query For Dynamic View..

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.