473,497 Members | 2,051 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with date parameter in stored procedure

4 New Member
Hello,

I made a stored procedure where u have to give the date in a paramater and then the result should come. But somehow it doesnt work.

It works likes this:

CREATE PROCEDURE [dbo].[spG_NeoTestDatesSerge]

AS


SELECT TestID
FROM dbo.Test
WHERE (DefinitionID = 7) AND (CONVERT(char(10), EndDate, 103) = '19/03/2007')
GO


When I test this , I get the result from testid.

Now when I put a variable in like this:

CREATE PROCEDURE [dbo].[spG_NeoTestDatesSerge]

@Datum varchar

AS


SELECT TestID
FROM dbo.Test
WHERE (DefinitionID = 7) AND (CONVERT(char(10), EndDate, 103) = @Datum)
GO


It doesnt work ! I dont get any results. I would give '19/03/2007' as paramater but it doesnt work.

Anyone has a clue ? Or a solution ?

thanks in advance
Apr 13 '07 #1
2 2512
iburyak
1,017 Recognized Expert Top Contributor
Did you try to change

[PHP]
@Datum varchar[/PHP]

to

[PHP]
@Datum varchar(10)[/PHP]
Apr 13 '07 #2
KaizerV3
4 New Member
Thank you my friend !

You have helped me alot !!
Apr 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
4368
by: Nyul | last post by:
Gurus, I have a verb big problem which I'm unable to explain. We have a DB2 V6.1.0 on AIX 4.3 I want to make a C stored procedure which at the end will be called by a PHP script. The...
2
1085
by: Viktor Popov | last post by:
Hi, I use ASP.NET/C#/MS SQL and I'm trying to do the following but I find it very hard! I have Stored Procedure which saves data from the Application into DataBase. One of its parameters is...
8
3245
by: JIM.H. | last post by:
Hello, I am calling a stored procedure to update my table. If one of the date on the screen left empty, I need to send date as null. Since MyDate=”” gives error in asp.net, how should I do...
7
3429
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function...
2
11487
by: syntego | last post by:
We commonly use triggers to log changes to our main tables to historical log tables. In the trigger, we create a concatenated string of the old values by casting them as follows: ...
4
7209
by: =?Utf-8?B?QmFidU1hbg==?= | last post by:
Hi, I have a GridView and a SqlDataSource controls on a page. The SqlDataSource object uses stored procedures to do the CRUD operations. The DataSource has three columns one of which -...
12
2222
by: Light | last post by:
Hi all, I posted this question in the sqlserver.newusers group but I am not getting any response there so I am going to try it on the fine folks here:). I inherited some legacy ASP codes in my...
1
1776
by: kizmar | last post by:
I'm having an issue with a stored procedure I'm working on. One of the parameters is a DATE field. I'm attaching to this stored procedure with Crystal Reports, which is passing something like...
2
2610
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to...
2
2802
by: priyamtheone | last post by:
I'm trying to create a stored procedure in MSSQL Server 2005 that'll perform the following jobs: 1) Create a login. 2) Create an user in TestDB database for the login created in step 1. 3) Assign...
0
6993
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7197
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6881
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
1
4899
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1411
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.