473,397 Members | 2,077 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,397 software developers and data experts.

Getting end of day from databox entered variable

347 100+
I have a web page that has a text box where customers can enter a date/time which is stored as a variable (@scheddate) which then I need to calculate the end of the day no matter what time they enter there. Is there a simple way to do that?

Thank you

Doug
Sep 12 '11 #1
5 1874
Rabbit
12,516 Expert Mod 8TB
Unless you define the end of the day as a fluctuating number depending on other factors, there's no need to calculate the end of the day. The end of the day is always the same time.
Sep 12 '11 #2
dougancil
347 100+
Rabbit,

Specifically, here's what I'm doing:

Expand|Select|Wrap|Line Numbers
  1. Try
  2.             If DateTime.TryParse(dateTextBox.Text, myDate) Then
  3.                 'Conversion was successful, the data is now in myDate
  4.                 newDate = myDate.AddDays(1)
  5.             Else
  6.                 errorlabel.Text = "Invalid Date"
  7.             End If
  8.  
and what I don't know how to do is to store the newdate value as a variable and pass that to my sql table. I don't have a control for this value on my page, so I don't know how to add it.
Sep 12 '11 #3
Rabbit
12,516 Expert Mod 8TB
Well, then put a control on the form, bind it to the field in the table, and set the value of that.
Sep 12 '11 #4
dougancil
347 100+
Rabbit, I don't want the user to have to enter anything other than the start time, based on that, I want to calculate what the end of the day is, store that as a variable and pass that to my sql server. Even though the end of the day is always 11:59:59, since I don't know the time that the user will be entering as the start time, I have no way to calculate that. Which is what I'm trying to do.
Sep 13 '11 #5
Rabbit
12,516 Expert Mod 8TB
They don't have to enter anything. You're putting the control on there so that you can bind it to the table and set the value in your code. It doesn't even have to be visible to the user.
Sep 13 '11 #6

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

Similar topics

4
by: Wayne Baswell | last post by:
I want to pass a date variable to a sql statement from Crystal Reports. The part of the query accepting the variables looks like: "Calendar_Date between To_Date('1-JUN-03','mm/dd/yy') and...
3
by: Joe Schwartz | last post by:
All, Could somebody please help me out here. I am getting an "Object variable or With block variable not set" error with the following code. This happens when I enter a value into the "ponum"...
2
by: Michael Cohen | last post by:
Hi, I have to write a function that gets variable number of parameters and pass them to another function (existing). The problem is that the prototype of the function I call has ",..." so I can't...
1
by: MattB | last post by:
OK, never mind my last post. It was easy enough to refer to the table the repeater is bound to, but I made a big, incorrect assumption in that post. In my last post I thought I was successfully...
11
by: David Veeneman | last post by:
I need to get a parent's private variable from within a control. Here's what I'm doing: I have a control that I want to be able to detect the presence of a particular (System.ComponentModel)...
2
by: bombardier | last post by:
I just switched ISPs and am in the process of moving all MySQL databases and PHP scripts to the new ISP. I have some simple HTML forms that post to simple PHP scripts that used to work with my old...
5
by: olaamussah | last post by:
Hi, i just started learning perl which i would use for my uni. project unfortunately. Well, this is a simple user login page i tried to create but i cant get it to work. Can someone please check this...
3
by: paul814 | last post by:
Is it possible using PHP to get the value of the current user logged in to the computer and then put that into a textbox? Say I log into my computer as smith I then want smith (or whoever) is...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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 project—planning, coding, testing,...
0
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...

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.