Dynamic dates for calendar

HI Folks,
Can anyone please tell me how I can create dates dynamically
for my quey?
I use the following query to query for events:
SELECT *
FROM events
LEFT JOIN eventtype
ON events.eventtype=eventtype.typeid
WHERE
(eventstart BETWEEN #startof# AND #endof#
OR eventend BETWEEN #startof# AND #endof#)
I would like to add previous month and next month links can
anyone tell me how I can add these to my query?
Thankyou

Hi,
Here's an example for the query as well as the previous-,
next-month links.
please note: your query is not correct, it would not return
any events that start before the selected timeframe and end after
the selected timeframe. Have a look below for a better way to query
for "overlapping dates".
cheers,
fober
<cfparam name="year" default="#year( NOW() )#">
<cfparam name="month" default="#month( NOW() )#">
<cfset startdate= createdate(year,month,1)>
<cfset previousdate= dateadd("m", -1, startdate )>
<cfset nextdate= dateadd("m", +1, startdate )>
<cfoutput>
<strong>QUERY:<br></strong>
SELECT *<br>
FROM EVENTS<br>
WHERE event_start < #createodbcdate( nextdate )#<br>
AND event_end >= #createodbcdate( startdate )#<br>
<br>
<strong>NAVIGATION:<br></strong>
<a href="?YEAR=#YEAR( previousdate )#&MONTH=#month(
previousdate )#">PREVIOUS MONTH</a><br>
<a href="?YEAR=#YEAR( nextdate )#&MONTH=#month(
nextdate )#">NEXT MONTH</a><br>
</cfoutput>

Similar Messages

  • Localdefinitions.xml and format date for Calendar Prompt

    HI!
    1. I change in localdefinitions.xml all dateformats for my locale
    2. I restarted my BI
    3. no effects
    why?

    yes, I restarted presentation server and oc4j.
    but has no effects.
    date prompt has strange behaviour...
    for Administrator user
    in English locale
    default format YYYY-MM-DD
    after change date by calendar, it has M.D.YYYY format
    in my locale
    default format YYYY-MM-DD
    after change date by calendar, it has YYYY.M.D format
    for other users
    in English locale
    default format YYYY-MM-DD
    after change date by calendar, it has YYYY.M.D format
    in my locale
    default format YYYY-MM-DD
    after change date by calendar, it has YYYY.M.D format

  • Change format date for Calendar Prompt!!!

    Hello there,
    For a date prompt when I choose *"Calendar"* in my control, the default format shown by the calendar is d/mm/yyyy.
    I want to save the value of my date prompt into a Presentation variable with the format yyyy-mm-dd. What conversion function can be used to achieve this?. In oracle the easiest way is TO_CHAR(dateHere,'YYYY-MM-DD') but when I apply this in the Edit Formula of the prompt it gives me an error.
    I know the date format for a Calendar object can be changed in the configuration file, but I want to avoid this, because I might affect other users.
    Please help.
    Thanks
    Edited by: PabloC2 on Feb 18, 2009 1:36 PM

    yes, I restarted presentation server and oc4j.
    but has no effects.
    date prompt has strange behaviour...
    for Administrator user
    in English locale
    default format YYYY-MM-DD
    after change date by calendar, it has M.D.YYYY format
    in my locale
    default format YYYY-MM-DD
    after change date by calendar, it has YYYY.M.D format
    for other users
    in English locale
    default format YYYY-MM-DD
    after change date by calendar, it has YYYY.M.D format
    in my locale
    default format YYYY-MM-DD
    after change date by calendar, it has YYYY.M.D format

  • How do i convert dynamic data for TCP transmission?

    I am doing a university reaseach project which will gather field data in a remote location (with a phone line), and i want to transmit this data back to the lab for recording and analysis. I have loaded the simple data server and client vi's, but cannot get my data into a suitable form for transmission. The data is aquired through a daq pad and displays on a waveform graph as well as writing to file. The output from the daq pad is dynamic data, and this is what i want to transmit...... any ideas. thanks Jack

    Hi Jack,
    try it in this way.
    Mike
    Attachments:
    Unbenannt.PNG ‏13 KB

  • BEX to allow for the dynamic date on a variant as is the case with ABAP

    Hi All,
    I have doubt that where we are able to use dynamic date for BEX date variable?
    In normal ABAP program,We have option to get dynamic date for date field parameters.Like that can we have dynamic date for BEX date variable.
    Please let me know.
    Thanks in advance for your help,
    Bandana.
    Edited by: Bandana Baghel on Jul 3, 2009 10:44 AM

    Hi Bandana,
    When you say dynamic date, are you refering to the system date on which the BEx query run?
    If so, there are SAP Exit variable available which can be used to retrieve system date at run time.
    Try using 0DAT variable which will return the system date at run time.
    Regards
    Amit Roy

  • Dynamic date in variant

    Hi,
    I need to create a dynamic date for my variant.
    Date will be the select option - The from date should be the current date and the to date should be current date + 30 days.
    When i am using the Selection variant and using the option D to calculate the current date+ 30 days. But that is getting stored in the from date but not in the to-date. My report will be running in back ground every day. So according to the requirment i need to have from date as current date and to-date as current date + 30 days.
    I cannot use the logic in initialization as the report will be running based on the variant saved.
    Thanks,
    Raju

    Hi Raj,
    I can think of one thing,
    just use parameters for start date and end date
    and then set the their values in the variant as follows,
    Press Save on the selection Screen and then put the name and short text then,
    in the very last box called "Selection screen objects 1000" check on the fourth check box "Selection variable" for both start date and end date.
    Then click on "selection Variable" Button on left hand top corner of the screen.
    Then click on the D: Dynamic date calculation the must turn Green.
    then click on the downward arrow that appears there you will have options to set the date.
    there choose current date for the start date and Current date +/- ??? days  for the end date.
    now while setting the end date it will ask you the number of days there you have to put 30(as it is your requirement) and SAVE.
    Then test it .
    otherwise you can go for this approach.
    Keep your date in select-options only and use the following option while selecting "Selection variables"
    "Current date - xxx,current date + yyy"
    Hope it helps you,
    Regards,
    Abhijit G. Borkar
    Edited by: Abhijit Borkar on Jan 7, 2010 7:31 AM

  • Writing dynamic data and extract it latter

    i want to write a waveform in a file so that in future i can see the saved waveform on the graph dynamically, i mean if i save the dynamic data for 3 hours can i get the data running on the graph for 3 hours in future please help........

    Saving data at 20kHz for three hours is close to 2GBytes (assuming saving DBL data type), so you probably want to use a binary file format. I would recommend using TDMS.  Each time you create a new data set, write it to a new channel with a unique name.  I would recommend using a timestamp as the name, so you can easily figure out when your data was taken and it is easy to generate the channel name.  Make sure you use enough time resolution in your timestamp name to make them unique.  Alternately, you can use an indexed channel name (e.g. Data0001, Data 0002, etc.).  If you do this, save the timestamp as metadata with each magnitude.  This may make it easier to fetch.
    Reading the data later is fairly easy.  Fetch the data you want using the channel name or timestamp, depending on how you stored it.  TDMS does support multiple access at the same time, so you can read and write "at the same time."
    If your data sets are large (megabyte or larger) you may want to take a look at Managing Large Data Sets in LabVIEW.
    Let us know if you need more information.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Dynamic date range

    I'm on ECC6.0, and looking to set up a dynamic date range in a variant.
    The date range is a select-option on my selection screen.
    I can easily setup the dynamic date for the 'low' value in the range,
    but I can see no way to also declare a dynamic date in the 'high' value.
    I also looked in TVARV maintenance and it doesn't seem possible there
    either, as there's no way to declare variable values.
    If I can't resolve this, I will have to change my program to include a
    default high date and use that.
    But even that may not work if we call the variant, which may overwrite
    my default in the high value of the range with a blank value.
    Does anyone know how to do this?
    Thanks in advance for your help.

    Hi Jagan,
    If you save the variant you can choose some options for the select-option. If you choose selection variabel type D (dynamic date calculation) you can choose out of several Names of Variables that provide for a LOW and HIGH value.
    If you use type T, you can choose a variable that is stored in tabel TVARVC. You can add your own variable to table TVARVC using SE16.
    Regards........
    Chaitanya.

  • Dynamic Payslips for multiple employees?

    Post Author: bhappy
    CA Forum: Formula
    Hi All,I need to generate pay slips for multiple employees using Crystal Reports.I can able to generate pay slip for one employee.But I can't generate pay slips for multiple employees.Can any one tell me any idea plz..............Thanks.

    Post Author: bhappy
    CA Forum: Formula
       Hi,Thanks for ur replay,Here i am not passing any
    table to crystal report.All values i am passing to formula fields bcuz
    all fields are dynamic i am not using any database field directly in my
    crystal report.All calculations i am doing in code behind (earnings and
    deductions calculations) so in code behind i will get one dataset with
    all data to generate payslips(all dynamic data for all employees) but
    formula field can hold only one value ???Any idea plz...........Thanks.

  • Dynamic selection of Calendar month/year

    I need to create a dynamic combo for calendar month/year, which will display the last 3 months.
    I have a query that displays the cumulated amounts for the last three months and I need to have a combo with the option to filter the query for only one of these months...
    How can I do that in Visual Composer?
    Thanks in advance,
    Cris

    Hi Cris,
    The simplest way is to create a service that's returns the correct month and use it as dynamic list for the drop-down.
    Hope it helps,
    Shay

  • MDX to dynamically create period to date for each month of current year

    I need some help with MDX. I am not even sure if this is possible to do but here is what I need.  Any help is greatly appreciated.
    I have a Date dimension with a hierarchy defined as Year-Qtr-Month-Date
    I have a measure called Rentals
    Assume the current date is 10/24/2014.  I want to display by month for the year 2014, the sum of rentals equivalent to the current MTD.  So January would sum 1/1 thru 1/24.  February would sum 2/1 thru 2/24.  March would sum 3/1 thru
    3/24, etc.
    On the end of the current month, all months would display the sum of the whole month. I am not concerned if a month ends on the 30th or 31st.  The end is end.
    It needs to be dynamic enough so that if the current date is the 27th, each month would sum from the 1st to the 27th.

    Hi Rocko,
    According to your description, you want to compare the sum amount of rentals for each month, right?
    In MDX, we can use
    PARALLELPERIOD function returns a member from a prior period in the same relative position as a specified member. So you can use the query like
    with set Period as {[Arrival Date].[Date].[Month].&[2014]&[1]:[Arrival Date].[Date].[Month].&[2014]&[27]}
    member [Arrival Date].[Date].[0] as sum({Period})
    member [Total Amount N-1] as (PARALLELPERIOD([Arrival Date].[Date].[Month], 1, [Arrival Date].[Date].[Year].&[11]), [Measures].[Total Amount])
    Here is a sample query on AdventureWorks cube.
    SELECT ParallelPeriod ([Date].[Calendar].[Calendar Semester]
    , 3
    , [Date].[Calendar].[Month].[October 2003])
    ON 0
    FROM [Adventure Works]
    Regads,
    Charlie Liao
    TechNet Community Support

  • Fiscal Calendar in Report Variant Dynamic Date Calculation

    We are switching from the standard calendar to a 4/4/5 calendar for our fiscal calendar. We have a number of batch reports that use dynamic date calculation in the variant to get Month-To-Date or Previous Month date ranges. Is there a way to convert these variants to use the new FiScal calendar instead of the regular calendar?

    thanks to answer , praveen.
    I know, VARI has name of FM , but not has Calendar ID.

  • Using htp.p for print dynamic data in apex region make my page slow?

    Hi, everyone!!! My name is Rafael, and...
    I search in the web and in this forum but i can´t find a answer for my doubt.
    Using the procedure htp.p for print dynamic data in apex region through on demand process , this will leave my webpage slow to load when the user access?
    Example:
    For build a menu in my webpage, it´s read a function in the database that returns variable string, so by a demand process this string is obtain and print in a web page using htp.p.
    I notice that this practice causes slow to load the data on the page.
    This is it...
    If someone help me, thanks...
    bye and Happy new Year!!!
    Edited by: user9518141 on 26/12/2009 17:19

    Hi,
    Try commenting out the function call and print some sample text in the htp.p like htp.p('Hello world..');
    I think the function call is probably taking a lot of time .. not htp.p.
    I have used htp.p to print out values dynamically in a lot of situations and have not ever come across any performance issues.It could be a problem with the function you are calling.
    Thanks,
    Rajesh.

  • Why can't I set a relative date for a recurring event in calendar on my ipod touch?

    why can't I set a relative date for a recurring event in calendar on my ipod touch?

    Because The Calendar app does not support it. There are apps in the App store that do.

  • I have a 4s...today, for no apparent reason, I am missing data including, calendar appts, notes, contacts and maybe other things that I am not aware of right now.  I did nothing to cause this.  Any ideas on how to restore?

    I seem to have lost a significant amount of data from calendars (ll appts are gone), notes (a good percentage are gone) and contacts (more than 50% are gone).  I have done nothing to cause this.  Any ideas how I might restore everything?

    try turning the phone off and then back on it worked for me.

Maybe you are looking for