?
Solved

SQL Reporting Services - Supply values to DateTime parameter

Posted on 2008-06-20
2
Medium Priority
?
1,738 Views
Last Modified: 2008-06-25
I have a query which is supposed to supply default values to Date_From and Date_To parameters for a report query.

The SELECT statement below provides date in the format YYYY/MM/DD , apparently this is not the format expected by the DateTime parameter.

What is value would DateTime be looking for?
0
Comment
Question by:egxis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
psychic_zero earned 1000 total points
ID: 21829540
I think the format it looking for is in format MM/DD/YYYY HH:MM:SS AM
eg. 6/20/2008 5:40:10 PM
0
 
LVL 15

Assisted Solution

by:rob_farley
rob_farley earned 1000 total points
ID: 21829558
Try using the format YYYYMMDD - without the slashes. Almost everything else is location-dependent.

If that still doesn't like it, try:

select cast('20080620' as datetime)

...to force it to evaluate it as a datetime, rather than a string.

Rob
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question