How to Convert MM/DD/YYYY to YYYY/MM/DD in SQL Reporting Services

i am having difficulty of converting a parameter field, called @startdate, on sql reporting services report to YYYY/MM/DD format.  the parameter @Startdate was set to Data/Time.  @Startdate is 6/1/2014 12:00:00 and I want to convert it
to 2014/06/01.  I want to compare @Startdate with a column in database called Begindate which is in format of YYYY/MM/DD hh:mm:ss.  I tried the followings
select * from Atable where cast(Atable.Begindate as date) >= cast(@Startdate as date)
select * from Atable where cast(Atable.Begindate as date >= cast(convert(datetime, @Startdate) as date)
SQL Reporting Services only gives me Text, Boolean, Date/Time, Integer and Float.
Regards,

Hi Elmucho,
Sorry for the delay. I tested with the sample data you provided, however everything works well in-house. Could you please creste a new report and check the result. Here are the steps I performed:
1.  Create a table and insert the following data:
Name (varchar(50))    Begindate (datetime, not null)    
Lastdate (datetime, not null)
bob                          
2008-01-01 08:08:08.000      2010-10-10  
10:10:10.000
alice                         
2010-10-10 10:10:10.00       2011-11-11
  11:11:11.000
smith                       
2011-11-11 11:11:11.00       2012-12-12   
12:12:12.000    
2. Open SQL Server Data Tools, create the data source and add the dataset with the below query:
SELECT     Name, Begindate, Lastdate
FROM         [tablename ]
WHERE     (CAST(Begindate AS date) >= CAST(@Startdate AS date)) AND (CAST(Lastdate AS date) <= CAST(@Enddate AS date))
3. Then, click execute button, it prompts for inputting the parameter value.
@Startdate        
6/1/2008
@Enddate          
5/1/2014
Enter the date and press OK.
4. Here is the result in the query designer:
Insert a table and fields. Save the report and preview:
Thanks.
Tracy Cai
TechNet Community Support

Similar Messages

  • How to find if the SQL Reporting services are stand alone or clustered ?

    Hi All,
    Can any one tell me how do i find if the SQL Reporting services are stand alone or clustered ?
    As there are no other SQL features installed on the server except for reporting.
    Is there any GUI or CLI command to check this ?
    Gautam.75801

    Hello,
    Do not open cluster administrator since SSRS cannot take advantage of Windows Clustering Services.
    You need see if the Network Load Balancing manager (NLB) (windows feature) is installed on the SSRS computer and open
    it to see if a NLB cluster has been configured.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • How to convert a String("yyyy-mm-dd") to the same but in Date format ?

    Hi,
    can anyone plz tell me how to convert a String to a date format.I'm using MSACCESS database.I want to store this string in the database.So i need to convert it to a date format since the table is designed such a way with date/time type for date field.I used SimpleDateFormat ,but i can't able to convert.The code is given below:
    coding:
    public String dateconvertion(String strDate)
    try
    SimpleDateFormat sdfSource = new SimpleDateFormat("yyyy-MM-dd");
    Date date = sdfSource.parse(strDate);
    SimpleDateFormat sdfDestination = new SimpleDateFormat("yyyy-MM-dd ");
    strDate = sdfDestination.format(date);
    catch(ParseException pe)
    System.out.println("Parse Exception : " + pe);
    return(strDate);
    }

    i used prepared statement even now i am getting error like this.....
    i have included the prepared statement package also...
    my coding:
    ResultSet rsdatetemp = null;
    PreparedStatement ps = null;
    String query ="select distinct itemcode from sales where bill date between ? and ?";
    ps = precon.prepareStatement(query);
    ps.setDate(1,d1);//d1 and d2 are in date format
    ps.setDate(2,d2);
    rsdatetemp = ps.executeQuery();
    error :
    symbol : method setDate(int,java.util.Date)
    location: interface java.sql.PreparedStatement
    ps.setDate(1,d1);
    symbol : method setDate(int,java.util.Date)
    location: interface java.sql.PreparedStatement
    ps.setDate(2,d2);

  • How does one give out enough spaces for a column in SQL report ?

    How does one reserve enough spaces for a column in SQL report ?
    Ex: 2 columns defined as the following
    projectNo varchar2(10)
    ProjectName varchar2(50)
    When create an sql report, the report heading will show below. If my project name is " Tire Strength Test At Site R987654" . I need to get it to show in one line since it was defined as varchar2(50)
    projectNo     ProjectName
    A0001         Tire Strength
                  Test At Site
                  R987654 There got to be a way to get around here . Thanx in advance.
    tai

    I noticed the CSS Style settings only seem to work if using a "Standard Report Column". Unfortunately I have the need to define some report columns where undesired wrapping occurs as "Display as Text (based on LOV, does not save state)" and tried to avoid wrapping, but no luck - is there a way around this (other than performing the report query using a huge DECODE clause, which somewhat renders the LOV useless except for data entry)?
    Thanks in advance for any ideas,
    Holger

  • How to convert dd.mm.yyyy into yyyymmdd??..

    I am reading input date as dd.mm.yyyy
    I want to convert it into yyyymmdd
    is there any function module???...
    Thanks
    Sri

    hi,
    Use convert_date_input or convert_date_internal.
    the previous is obsolete with respect to some of the systems and the later isn't obsolete.
    Use as per your requirement.,
    CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
        EXPORTING
          date_external              = input
    *     ACCEPT_INITIAL_DATE        =
        IMPORTING
          date_internal              = output
        EXCEPTIONS
          date_external_is_invalid   = 1
          OTHERS                     = 2
    Thanks
    Sharath

  • How to convert dd-MM-yyyy into yyyy-MM-dd format in mysql

    i have designed a database in mysql and i have connected it using jdbc connectivity . so i want to convert an input date with this format dd-MM-yyyy into yyyy-MM-dd a legal format of mysql

    Friends , I found another way to get a mysql format
    String dateString = "23/08/2003"; (this string can be input date)
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
         java.util.Date d;
         try
              d = dateFormat.parse(dateString);
              dateFormat.applyPattern("yyyy-MM-dd");
              dateString = dateFormat.format(d);
         catch (Exception e){
                   e.printStackTrace();
              java.sql.Date a3 = java.sql.Date.valueOf(dateString);
    where a3 is the date with the mysql format needed and can be inserted into sql statement.

  • How to convert a numeric field representing UNIX time to a standard report

    Looking for some help on the creation of a formula that will allow me to convert a numeric string which represent Unix time to a standard date format.
    Sample string value "1199149200", Jan 1 2008, 1 AM

    Hi,
    Use the DateAdd formula convert Unix epoch to normal datetime (Unix epoch = number of seconds that have elapsed since January 1, 1970).
    DateAdd("s", 1199149200, datetime("01/01/1970 00:00:00"))
    Cheers,
    Fritz

  • Hiii, i have m rows & n columns in my table..how to convert it into m columns & n rowa by using sql..pls help me...thanks.

    hiii,
    I have a table which has 14 rows & 8 cols.
    I want covert it into 14 cols & 8 rows,
    by using sql how to do it..pls help me.

    Oracle Database Search Results: pivot

  • How to create alternate color columns in MS SQL reporting services (rdl)

    I found something related to row coloring at ::
    http://weblogs.sqlteam.com/joew/archive/2008/08/20/60691.aspx
    i went through all the properties for column but none that would help me achive me goal.
    SO in my case .. the no of rows are fixed .. but columns vary .. so i wnat the alternate columns to be of different color (say white and silver)

    Hi,
    Once my no of data sets (mine is 3 columns per data set) changes, the highlighting 'shifted' like below. Any idea how this happen?

  • [Forum FAQ] How do I export each group data to separated Excel files in Reporting Services?

    Introduction
    There is a scenario that a report grouped by one field for some reasons, then the users want to export each group data to separated Excel files. By default, we can directly export only one file at a time on report server. Is there a way that we can split
    the report based on the group, then export each report to Excel file?
    Solution
    To achieve this requirement, we can add a parameter with the group values to filter the report based on the group, then create a data-driven subscription for the report which get File name and parameter from the group values.
    In the report, create a parameter named Name which use the Name field as Available Values (supposing the group grouped on Name field).
    Add a filter as below in the corresponding tablix:
    Expression: [Name]
    Operator: =
    Value: [@Name]
    Deploy the report. Then create a data-driven subscription with Windows File Share delivery extension for the report in Report Manager.
    During the data-driven subscription, in the step 3, specify a query that returns the Name field with the values as the group in the report.
    In the step 4 (Specify delivery extension settings for Report Server FileShare), below “File name”option, select “Get the value from the database”, then select Name field.
    Below ‘Render Format’ option, select Excel as the static value.
    In the step 5, we can configure parameter Name “Get the value from the database”, then select Name field. 
    Then specify the subscription execute only one time.
    References:
    Create a Data-Driven Subscription
    Windows File Share Delivery in Reporting Services
    Applies to
    Reporting Services 2005
    Reporting Services 2008
    Reporting Services 2008 R2
    Reporting Services 2012
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thanks,
    Is this a supported scenario, or does it use unsupported features?
    For example, can we call exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='b64ce7ec-d598-45cd-bbc2-ea202e0c129d'
    in a supported way?
    Thanks! Josh

  • How to convert an ascii file into dBase .dbf file type

    Does any one out there know how to convert an ascii file(which is generated from PL/SQL script) into a .dbf (dBaseIII) file type? Thanks in advance.

    I haven't worked with dBase for about 20 years, but I seem to recall it having an IMPORT command for that purpose. But maybe I'm wrong...

  • How to Convert Date (DD.MM.YYYY) to be just DD

    Hi experts,
    I have no idea how to convert Date format (DDMMYYYY) to be just DD.
    Example:
    I have date: 31.10.2009
    now i just want to show in report as 31.
    I just known if we just want to show month only, we could use the 0CALMONTH2. but how if i need the day only?
    Are there any way, either in query (BEx) or modeling (Routine/Formula in Update Rules or Transfer Rules) which could fulfill the requirement?
    Many thanks..
    Warm Regards,
    Tika

    Hi,
    go through the link below and modify according to your requirement
    Date conversion from YYYYMMDD to DD.MM.YYYY
    Regards,
    Marasa.

  • How to convert the date time from MM-DD-YYYThh:mm:ss to YYYY-MM-DDThh:mm:ss format

    Hi All,
    I have a requirement in my project like to convert the date time from one format to another.my situation is like to convert the date time from MM-DD-YYYThh:mm:ss to YYYY-MM-DDThh:mm:ss format. I am using the soa suite 11.1.1.6.
    Can any one suggest me how to convert in the BPEL transformation.
    Thanks,
    Sanju.

    Hi Sanju,
    Store the date to be converted into a variable viz. dateVar. Now, process an expression in assign as: xp20:format-dateTime($dateVar,'[Y0001]-[M01]-[D01] [h]:[m01]:[s01]').
    Regards

  • How to convert a date from "yyMMddHHmmss" into "yyyy-MM-dd HH:mm:ss format

    hi
    please help i got the date "yyMMddHHmmss this format, how do i convert this into "yyyy-MM-dd HH:mm:ss" format using java code
    please help me anybody having idea

    YoungWinston wrote:
    jverd wrote:
    ...you don't need to know anything about dates or calendars to do that transformation, other than the rules for converting a 2-digit year to a 4-digit one.
    @OP: And for that, you have [SimpleDateFormat.set2DigitYearStart()|http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/java/text/SimpleDateFormat.html#set2DigitYearStart%28java.util.Date%29].
    WinstonRight. But I was talking about the case where we just use string manipulation directly, and skip DateFormat altogether. In this case we just need and if check against the int value of the first two digits.

  • How to convert date from "yyyymmdd" to "MM/DD/YYYY" format

    1. I have one BLDAT field in my internal table.
       its getting updated from input file.
    2. The value in the input file is like yyyymmdd.
       So the internal table field is filled like this
       "YYYYMMDD".
    3. After this,I have to compare this internal table  
       field with BSAD table.
    4. The BLDAT field in BSAD table is in the format of 
       "MM/DD/YYYY".
    5. the BLDAT field is having diff format in internal  table and BSAD table.So I am unable to check this value.
    How to convert it as like the BSAD table format."MM/DD/YYYY" format.
    Thanks in advance!!

    Using the WRITE statement
      data: gd_date(10).  "field to store output date
    * Converts date from 20020901 to 09.01.2002
      write sy-datum to gd_date mm/dd/yyyy.
    OR u can
    CONCATENATE gd_date+4(2) gd_date+6(2) gd_date+0(4)
    into gd_date seperated by '/' .
    Hope this helps.
    Kindly reward points and close the thread for the
    answer which helped u OR get back with queries.

Maybe you are looking for

  • X-Fi XtremeMusic Surround questi

    I bought this card thinking that I could hook up digital(optical) audio -without- the breakout box, but there is no place that says you can't. So now I have a receiver that I can't run digital on..yet. Its a Pioneer 5. Home Theater system. It has dig

  • In times of slow Internet, Thunderbird repeatedly says sending timed out, but it actually sends, resulting in multiple emails.

    That about sums it up. I feel very unprofessional when it happens. Can I determine from within Thunderbird when it sends or doesn't send? How can I fix it? Is there a way to tell Thunderbird to prevent multiple identical emails? When it times out, it

  • License Consumption in BOE XI

    Post Author: neheyen CA Forum: Authentication I don't know if we don't have enough licenses or if there is something misconfigured. Or if there is a problem with usage. When I go to the CMS properties, I think I see who is logged in at the moment. Ju

  • Long distance in local calling area

    I have set up some Skype to go numbers in my calling area and some of them are working but when I dial others Bell Canada says the number is a long distance number.  Is there any way to chose the number (ie 613 927 XXXX or 613 434 XXXX) instead of it

  • Opening another java class from a class itself?

    I want to run a java program(lets call it preInput.java) that has a bunch of inputs and some buttons, and on one of these buttons I click, it opens a driver program that uses the input from preInput.java. Is this possible? Thanks for the help