Convert String to Date and Format the Date Expression in SSRS

Hi,
I have a parameter used to select a month and year  string that looks like:    jun-2013
I can convert it to a date, but what I want to do is,  when a user selects a particular month-year  (let's say "jun-2013")
I  populate one text box with the date the user selected , and (the challenge Im having is)  I want to populate a text box next to the first text box with the month-year  2 months ahead.    So if the user selects 
jun-2013   textbox A will show  jun-2013 
and textbox B will show  aug-2013..
I have tried:
=Format(Format(CDate(Parameters!month.Value  ),  
"MM-YYYY"  )+ 2  )   -- But this gives an error
This returns the month in number format   like "8"    for august...
=Format(Format(CDate(Parameters!month.Value  ), 
"MM"  )+ 2  )
What is the proper syntax to give me the result    in this format =  "aug-2013"  ???
Thanks in advance.
MC
M Collier

You can convert a string that represents a date to a date object using the util.scand JavaScript method, and then format a date object to a string representation using the util.printd method. For more information, see:
http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.1254.html
http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.1251.html
In your case, the code would be something like:
var sDate = "2013-01-10";
// Convert string to date
var oDate = util.scand("yyyy-mm-dd", sDate);
// Convert date to new string
var sDate2 = util.printd("mm/dd/yyyy", oDate);
// Set a field value
getField("date2").value = sDate2;
The exact code you'd use depends on where you place the script and where you're getting the original date string, but this should get you started.

Similar Messages

  • Comparing the Dates and Exclude the Dates with Blank one in BEx Query

    Hi all,
        I have created the Formula Variables ZFV_DATE1 on ZDATE1, ZFV_DATE2 on ZDATE2,
           Calculated KF ZCKF_Date with 'ZV_DATE1 <  ZV_DATE2' and
           Restricted KF ZRKF_DATE on Key Figure ZCKF_DATE & Characteristic ZDELETE = 'X' to find the Count.
    I should exclude if any ZDATE1 or ZDATE2 is Blank in the report. So I kept ZDATE1 & ZDATE2 with Exclude when it is Blank in Filter Section. It is excluding globally all Blank ZDATE1 & ZDATE2, but the Calculated KF logic 'ZV_DATE1 <  ZV_DATE2' is not working. It has 'ZV_DATE1 > ZV_DATE2' records also. Next I moved ZDATE1 & ZDATE2 to Restricted KF ZRKF_DATE to Exclude the Blank dates and the report doesn't show correct results. How could I get the correct results with 'ZV_DATE1 < ZV_DATE2' and any ZDATE1 or ZDATE2 is not Blank.
    Thanks,
    Venkat.

    In that case, you approach seems to be mor or less correct. Restrcit the report using Filters on ZDATE1 and ZDATE2 not equal to Blank. You have mentioned that you have defined the CKF as 'ZFV_DATE1 < ZFV_DATE2'. i am assuming you have used boolean operator here. In this case it would  result in '1' when the condition is true (i.e, when ZFVDATE2 is greater than ZFVDATE1), else it will result in a '0'. Now, in your report, you should create a condition where you only keep the records where this CKF, ZCKF_Date = 1. This would filter out all the ZCKF=0 records, and hence only thiose records with ZFV_DATE1 < ZFV_DATE2 would be shown.
    Regards,
    Satwik

  • How can I get the data and store the data dynamically generated?

    When I entered an order, after the information for the order has been filled in, an order number has been generated dynamically. I want to record this number to my databank.
    The questions are, 1\how can I record the order number? 2\How can I write it back to my databank?
    I noticed Openscript_User_100 had asked the similar question, the post is here,
    Openscript - How to save data to Data bank at runtime
    Openscript - How to save data to Data bank at runtime
    Can Openscript_User_100 or somebody else be more specific on how to do that?
    Can I use the forms.textField.storeAttribute to do that? Where can I find the example for forms.textField.storeAttribute?

    Thanks aamat!
    I tried to look for the orderID in the detail pane HTML, I only have a screen shot in the Detail pane (Is this Detail Pane found in View-Details?) I can see the orderID on the screen shot (there is no other tab Screenshot is the only tab) but I cannot select it and replace it with variable.
    The only place I can select the orderID is in the Java Code,somehow the orderId is recorded there. Please see the code below.
    (I changed"[" to "{" in order to show the code correctly)
    beginStep("{11} Sales Orders (15371) - XXXX Customer", 0);
              forms.captureScreenshot(229);
                   think(8.39);
              forms.textField(230, "//forms:textField{(@name='ORDER_SOLD_TO_0')}")
                        .setFocus();
                   think(0.812);
              forms.window(231, "//forms:window{(@name='ORDER')}").selectMenu(
                        "Tools|Scheduling");
         endStep();
    Can you advise further?
    Edited by: DorothyLi on Dec 15, 2009 11:21 AM

  • I want to take a series of hex characters in a string control and produce an HDLC string indicator for example if the data string control is 3F27 then the HDLC string indicator is 7E003F2700B57E

    I want to take a series of hex characters in a string control and produce an HDLC string indicator for example if the data string control is 3F27 then the HDLC string indicator is 7E003F2700B57E

    "thanks for your help "
    Does that mean you figured it out already?
    If not, see this thread for some HDLC related code.
    http://forums.ni.com/ni/board/message?board.id=170&message.id=146859&query.id=3388#M146859
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • When attempting to format region and set date and time the busy icon appears and seems to stay like this?

    when attempting to format region and set date and time the busy icon appears and seems to stay like this?

    Click on DU's Partition tab when you have the raw drive name selected, then set it to one partition, Mac OS Extended. If it crashes or freezes, it is finding a bad block and can't write.
    In any event, if you want to use the drive, and have not zeroed it before, you should now.
    Click on Erase -> Security Options -> Zero out data. Still with the full drive selected and not any partition(s).
    Then repartition the drive if needed.
    Boot from the DVD if that doesn't work. And no, TTPro has never mapped out bad blocks let alone create partitions.
    Disk Utility in 10.4.8 is quite good, excellent in fact. No need for an alternative.
    Your eMac drive may need to touch of Disk Utility itself. FSCK from the command line, clear the caches with Applejack along with check for corrupt plists. Between Disk Utilty and Applejack (free/shareware) never had to use TechTool Pro - or at least there weren't any errors after those two got done. But if you want a good 3rd party, pick up Disk Warrior 4.

  • Connecting webservice and retrieve the data in json format.

    Hi,
    I need to connect to web service using java and retrieve the data in the format of JSON.
    I'm pretty new to this kind of technology, so kindly inform me about the class which are to be used.
    Thanks in advance

    There isn't one class that will solve your problems. You need to use many classes, and it's not a trivial task.

  • Need help in formatting the Date - Date does not

    Need help in formatting the Date - Date does not formats and give Not a valid month error in the below scenario.
    select oc.ST_PGM_MGR, r.ag_dnum, get_major_work_type(r.perf_eval_rtng_id) "v_work_code", r.ag_dnum_supp "supp", r.intfinal, to_char(r.formdate,'MM/DD/YYYY') "formdate", to_char(r.servfrom,'MM/DD/YYYY') "srv_from", to_char(r.servto,'MM/DD/YYYY') "srv_to", descript, add_months(to_char
    --- Bellow line of Code on trying to format it to mm/dd/yyyy gives the error
    (r.formdate, 'DD-MON-YYYY'),12) "formdate2"
    from  table REdited by: Lucy Discover on Jul 7, 2011 11:34 AM
    Edited by: Lucy Discover on Jul 7, 2011 1:05 PM

    Your syntax is wrong - look at the post above where this syntax is given:
    to_char (add_months(r.formdate,12), 'MM/DD/YYYY') "formdate2"Look at the formula from a logical perspective - "inside out" to read what is happening -
    take formdate, add 12 months
    add_months(r.formdate, 12)then apply the to_char format mask - basic syntax
    to_char(date, 'MM/DD/YYYY')Compare to your syntax:
    to_char(add_months(r.formdate, 'MM/DD/YYYY'),12) "formdate2"You will see your format string inside the call to add_months, and your 12 inside the call to to_char.
    Good luck!

  • Getting a problem in mounting and unmounting the data in NI-9802

    hii,
         i am using 9802 memory module, using cRIO 9081. I want t o use both scan and FPGA mode at the same time. I have compiled a  NI-9802 method FPGA vi,  and then i have simulated the NI-9802 RT access host vi , and getting a error 65010. So anyone can help me to sort out this problem.
    I am also getting a problem, that how to read and write the data in NI-9802. 

    You have to escape the apostrophe. Use this code to format Strings.
      private String formatStringForSQL(String param){
            StringBuffer strBuffer = new StringBuffer();
            if (param == null) {
                return param;
            strBuffer.append("'");
            for (int i = 0; i < param.length(); i++) {
                  if (param.charAt(i)== '\'') {
                     strBuffer.append("\'");
                  } else {
                      strBuffer.append(param.charAt(i));
            strBuffer.append("'");
            return strBuffer.toString();
      }

  • Writing the file using Write to SGL and reading the data using Read from SGL

    Hello Sir, I have a problem using the Write to SGL VI. When I am trying to write the captured data using DAQ board to a SGL file, I am unable to store the data as desired. There might be some problem with the VI which I am using to write the data to SGL file. I am not able to figure out the minor problem I am facing.  I am attaching a zip file which contains five files.
    1)      Acquire_Current_Binary_Exp.vi -> This is the VI which I used to store my data using Write to SGL file.
    2)      Retrive_BINARY_Data.vi -> This is the VI which I used to Read from SGL file and plot it
    3)      Binary_Capture -> This is the captured data using (1) which can be plotted using (2) and what I observed is the plot is different and also the time scare is not as expected.
    4)      Unexpected_Graph.png is the unexpected graph when I am using Write to SGL and Read from SGL to store and retrieve the data.
    5)      Expected_Graph.png -> This is the expected data format I supposed to get. I have obtained this plot when I have used write to LVM and read from LVM file to store and retrieve the data.
    I tried a lot modifying the sub VI’s but it doesn’t work for me. What I think is I am doing some mistake while I am writing the data to SGL and Reading the data from SGL. Also, I don’t know the reason why my graph is not like (5) rather I am getting something like its in (4). Its totally different. You can also observe the difference between the time scale of (4) and (5).
    Attachments:
    Krishna_Files.zip ‏552 KB

    The binary data file has no time axis information, it is pure y data. Only the LVM file contains information about t(0) and dt. Since you throw away this information before saving to the binary file, it cannot be retrieved.
    Did you try wiring a 2 as suggested?
    (see also http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=925 )
    Message Edited by altenbach on 07-29-2005 11:35 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Retrive_BINARY_DataMOD2.vi ‏1982 KB

  • IS it possible to Format the data to CXML format in Java ?

    Hi all,
    I am new to Java programming. I am an SAP ABAP Developer and in my SAP CRM E-Commerce Web Shop coding, I have to do coding in Java.
    My current requirement is that I have some set of data and I have to format this data to CXML format in Java. IS this possible?
    Can I format the data to CXML format in Java? Are there standard API's to do this? Please let me know how should I procced with the coding?
    Apart from formatting the output to CXML format, I have to also post this data to an external market place...How can I do this?
    Please help me with relevant information. your help will be highly appreciated.
    Regards,
    Jessica Sam

    It should be possible to format the data, yes. If there's a "standard API" it should be one that comes out of that SAP CRM thing, so look there.
    As for "posting to an external marketplace", that's far too vague a concept to be able to answer. You should start by getting the specs about "how to post" from that marketplace.

  • How do I take two separate non numeric fields in a acrobat form and combine the data to display in a third separate field?

    How do I take two separate non numeric fields in a acrobat form and combine the data to display in a third separate field?

    You have to use custom JavScripting to concatenate the first 2 fields. You cannot use the first 2 calculation options because they force the values of the fields to a numeric value or ignore string values.
    Possible scripts for the 3rd field are:
    event.value = this.getField("Text1").valueAsString + " " + this.getField("Text2").valueAsString;
    or
    event.value = this.getField("Text1").valueAsString.concat( " ",  this.getField("Text2").valueAsString);
    If you do not want change the separator or not show the separator when on or the other field is empty, you will need to add more code to adjust for change.
    The above scripts will also concatenate number because the field values are read as strings and not numbers.
    There is also a generalized user written function to concatenate up to 3 fields with a separator that adjust for missing data.

  • How to Read the one Source Column data and Display the Results

    Hi All,
         I have one PR_ProjectType Column in my Mastertable,Based on that Column we need to reed the column data and Display the Results
    Ex:
    Pr_ProjectType
    AD,AM
    AD
    AM
    AD,AM,TS,CS.OT,TS
    AD,AM          
    like that data will come now we need 1. Ad,AM then same we need 2. AD also same we need 3. AM also we need
    4.AD,AM,TS,CS.OT,TS in this string we need AD,AM  only.
    this logic we need we have thousand of data in the table.Please help this is urgent issue
    vasu

    Hi Vasu,
    Based on your description, you want to eliminate the substrings (eliminated by comma) that are not AD or AM in each value of the column. Personally, I don’t think this can be done by just using an expression in the Derived Column. To achieve your goal, here
    are two approaches for your reference:
    Method 1: On the query level. Replace the target substrings with different integer characters, and create a function to eliminate non-numeric characters, then replace the integer characters with the corresponding substrings. The statements
    for the custom function is as follows:
    CREATE FUNCTION dbo.udf_GetNumeric
    (@strAlphaNumeric VARCHAR(256))
    RETURNS VARCHAR(256)
    AS
    BEGIN
    DECLARE @intAlpha INT
    SET @intAlpha = PATINDEX('%[^0-9]%', @strAlphaNumeric)
    BEGIN
    WHILE @intAlpha > 0
    BEGIN
    SET @strAlphaNumeric = STUFF(@strAlphaNumeric, @intAlpha, 1, '' )
    SET @intAlpha = PATINDEX('%[^0-9]%', @strAlphaNumeric )
    END
    END
    RETURN ISNULL(@strAlphaNumeric,0)
    END
    GO
    The SQL commands used in the OLE DB Source is like:
    SELECT
    ID, REPLACE(REPLACE(REPLACE(REPLACE(dbo.udf_GetNumeric(REPLACE(REPLACE(REPLACE(REPLACE([ProjectType],'AD,',1),'AM,',2),'AD',3),'AM',4)),4,'AM'),3,'AD'),2,'AM,'),1,'AD,')
    FROM MyTable
    Method 2: Using a Script Component. Add a Derived Column Transform to replace the target substrings as method 1, use Regex in script to remove all non-numeric characters from the string, add another Derived Column to replace the integer
    characters to the corresponding substring. The script is as follows:
    using System.Text.RegularExpressions;
    Row.OutProjectType= Regex.Replace(Row.ProjectType, "[^.0-9]", "");
    References:
    http://blog.sqlauthority.com/2008/10/14/sql-server-get-numeric-value-from-alpha-numeric-string-udf-for-get-numeric-numbers-only/ 
    http://labs.kaliko.com/2009/09/c-remove-all-non-numeric-characters.html 
    Regards,
    Mike Yin
    TechNet Community Support

  • I am new to the ethernet communicat​ion using labview. I do not have any hardware. I have two laptop i need to send and recieve the data via these 2 laptop using labview. Kindly help me on this.

    i am new to the ethernet communication using labview. I do not have any hardware. I have two laptop i need to send and recieve the data via these 2 laptop using labview. Kindly help me on this.
    Solved!
    Go to Solution.

    Hi thanks for the help.
    Actually i am trying to send 10 sine signals from server pc to client pc. So i will bundle 10 signals in server pc and send it and in client pc i am unbundling it and need to save in TDMS format.
    Till unbundling i was able to do. TDMS format it is saving only last value. I need to save all the values. Kindly help me on same. I am attaching both the VI.
    Attachments:
    Client.vi ‏62 KB
    Server.vi ‏252 KB

  • How to assign a button for attachment and send the data through browser ?

    Hi friends,
    How to convert to browser ?
    how to assign a button for attachment and send the data through browser ?
    Thanking you.
    Regards
    Subash.

    Refer to
    How to create a text box in ascreen painter?
    where another user (venkateshwar reddy) has asked a very similar question...
    Jonathan

  • Update Excel to sharepoint and edit the data.

    Hi experts,
    Happy New Year to all,
    I would like to know is it possible to update my excel sheet having 10 different fields (Columns) to share point, and edit them as a list. Want to know step by step procedure.
    My requirement is as below
    I want to update the list of activities for each member of my team, in a excel in the first 5 columns and then upload to the share point daily, as my team members were placed in different locations, I want them to update their achivements
    for the day in the next 5 respctive columns. By filtering on their names respectively. So that  I can check online and take the report back to excel whenevery i required.
    I want to know
    1) Step by step procedure I can upload the excel to share point
    2) is it possible to restrict the data on particular field, to respective users.
    Request to let me know how i can achive.

    Excel and SharePoint List does not allow two way sync it is only unidirectional.
    You have to go by Scott's suggestions or else Office Web Apps which will allow excel Semiformal co-authoring (http://office.microsoft.com/en-us/sharepoint-server-help/document-collaboration-and-co-authoring-HA101812148.aspx).
    Here is how you can use the import Excel funcationality in SharePoint custom list.
    1. Define a table to your Excel Data and Save the excel file
    2. Go to your site, create a new list either using Site Settings or All site content menu, by selecting Import SpreedSheet
    3. select table in the import dialog box
    SharePoint will create a new list with the excel data.
    As per your requirement , the challenges that we have are -
    "a excel in the first 5 columns and then upload to the share point daily"
    You cannot reimport excel to a list as per your above requirement, there is only one way of importing to a list library and every time it will create a new list.
    " I can check online and take the report back to excel whenevery i required."
    You can export the list to excel file for processing offline and again there is no resync between Excel and List.
    "is it possible to restrict the data on particular field, to respective users"
    You can use item level permission for restricting user access to a list item or use SharePoint designer custom workflow to give item level access.
    http://www.sharepointbriefing.com/spcode/article.php/3911751/Implementing-ItemLevel-Security-in-SharePoint-2010-and-2007.htm
    http://social.msdn.microsoft.com/Forums/en-US/1911c999-8083-4d35-9cdc-3b9c3a7242a7/how-to-create-item-level-permission-for-list-in-sharepoint-2010?forum=sharepointgeneralprevious
    Hope this helps!
    MCITP: SharePoint 2010 Administrator
    MCTS - MOSS 2007 Configuring, .NET 2.0
    | SharePoint Architect | Evangelist |
    http://www.sharepointdeveloper.in/
    http://ramakrishnaraja.blogspot.com/

Maybe you are looking for

  • VGA to DVI VGA splitter

    Well, at least this is what I think I need. At work I have a regular PC with a small screen that I believe uses a VGA connection, I have a three year old Mac screen (aluminum case)which has a DVI connection. I want to add the Mac screen to the PC as

  • MSS CO Reports

    Hi, I do have a question regarding MSS CO reports,  we have around 55 cost centres and the requirement is that each manager looks only at his own Cost Centre report. Is there any way where i can create a role that depends on OM structure whereby the

  • CS5 InDesign Crashing

    Good Morning We're running CS5 on Windows 7 64 bit and when I try and delete some text from a particular file I get the below error message. I've done a bit of looking around but haven't been able to find anything that's done the trick as yet. If you

  • My camera is a sony dsc-w330! I can't get my cord to go into the camera so I can download my picture

    Hi, My kids bought me a sony camera  dsc=w330 cyber=shot last year in october! The camera is fine except I can't get the cord to go into the camera to download it to my computer! It was always a little hard to get it to go into it but now it won't go

  • Is It Possible To Delete Certain Clips From An Archive?

    After successfully completing an Archive, I noticed there are certain clips that I will never use and would like to get rid of them.  I realize that i don't have to import them into my Events  but don't see a reason to have them taking up HD space.