473,378 Members | 1,412 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Passing Time Value To Stored Proc in through Input Parameters property of Form. ADP

Hello All

Ive been creating my first access project in Access 2000 and SQL Server. Its up and running now for 35 users and has been pretty much a success, though ive been stopped in my tracks quite often to figure out how to get these applications to talk with eachother.

Todays problem:
I want to pass time figures to a stored procedure using a forms Input Paramaters property, namely @StartTime and @EndTime (both are defined as datetime typesin the stored proc).

Ive tried
@StartTime = '00:00', @EndTime = '00:00'
@StartTime = #00:00#, @EndTime = #00:00#
and a few others.

PS the stored procedure works fine if run it from the stored procs tab and i type 00:00 and 23:59 into the input boxs when prompted.

I know that access stores a 0 date as 1899-12-30 and SQL uses a different date, but i dont think thats the issue as all dates stored in the db come from the Access front end.

Can anyone help?

Regards

Gary
Jan 13 '09 #1
6 4493
NeoPa
32,556 Expert Mod 16PB
How are you invoking the stored procedure Gary?

I would expect the two values to be passed as parameters, but there are probably various other ways.

Can you put in some examples of your code to illustrate please. Not the whole process necessarily - simply enough to illustrate how you're attempting to pass the values across.
Jan 13 '09 #2
To clarify

In the forms property page the recordsource of the form is set to the name of the stored procedure.

The Input parameters property of the form will contain the parameters that the stored procedures requires.
This works fine for stored procs that require integer or string datatypes eg

@intMyParam1 = 6, @strMyParam2 = 'xyz'

Would work fine, but i need to know the syntax to pass times to the stored proc.....
Jan 13 '09 #3
NeoPa
32,556 Expert Mod 16PB
I don't know about that way of passing data (communicating) but I do know that date and time literals in ANSI SQL standard (ANSI-92) are all enclosed in hashes (#). How a time without a date is used I'm not positive. I'd have said simply as #01:30# or such like, but you've already found that not to work it seems. Maybe the AM/PM is required #01:30 PM#.

If you don't get any joy I'll be happy to move this across to the SQL Server forum for you. Just let me know.
Jan 13 '09 #4
Might be best to try the SQL Server Forum then Neo if you would

Thanks

Gary
Jan 13 '09 #5
NeoPa
32,556 Expert Mod 16PB
Consider it done (It has been :D).
Jan 13 '09 #6
ck9663
2,878 Expert 2GB
I would recommend that you include the date part in the parameter. Here's why. If your start time is before midnight (1130PM) and your end time is after (1230AM) midnight, and you only include the time, it will default to the same day. That would mean the calculated duration will be 11 hours instead of just 1 hour. Unless you are 100 percent that it will not be the case.

For the passing if the parameter part, could you hard code the dates when passing just to test the SP.

Also, see if you can find something here.


-- CK
Jan 14 '09 #7

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

Similar topics

3
by: Hursh | last post by:
Hi, I have written some stored procedures in SQL and these procedures return some value. I want these values to be captured by the ASP code. I am able to access the tables using ADO(...
2
by: zlatko | last post by:
There is a form in an Access Project (.adp, Access front end with SQL Server) for entering data into a table for temporary storing. Then, by clicking a botton, several action stored procedures...
3
by: rsherman | last post by:
I am running a windows app. with a stored procedure and the stored proc runs up to 90 seconds, the time out in the connection string is set for 90 seconds. It seems that the time out setting is...
7
by: rickcheney | last post by:
I just changed my Access 2002 database to a SQL Server ADP project. I had a form where the user entered a value into a text box and when a command button on the form was clicked a Report was...
2
by: Bob | last post by:
I'm new to Access projects and SQL server and am not a veteran VB programmer. There's a cry for help! I'm attempting to print the current form on screen by using a command button which the user...
4
by: Mike Dinnis | last post by:
Hi, I've been working through a number of turorials to try to learn more about retrieving data from a SQL database. I think i've mastered techniques where i create a sql string in the page and...
2
by: Martin Raychev | last post by:
Hi all, I have the following problem: I have a private method that returns a SqlDataReader. For this to work I have not to close the DB connection in the above method. I do this only to
4
by: Magy | last post by:
What would be the best way to execute a Oracle stored procedure that excepts several input paramters, through a web method in vb.net. What would be a good way to get to the web method, the Oracle...
0
by: mirandacascade | last post by:
Questions toward the bottom of the post. Situation is this: 1) Access 97 2) SQL Server 2000 3) The Access app: a) sets up pass-thru query b) .SQL property of querydef is a string, the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.