473,467 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

What do I use in Sql to replace a subtraction symbol

24 New Member
I am using some code from an access db that works how do I convert it in SQL?
Below is one line of the code. Thanks as always for your help.

[Loading Time In]-[order time in] AS [percent of load]
Mar 25 '10 #1

✓ answered by nbiswas

Use the DATEDIFF function whose general syntax is

Expand|Select|Wrap|Line Numbers
  1. DATEDIFF ( datepart , startdate , enddate )
So for your case the query will be

Select Datediff(day,[Loading Time In],[order time in]) AS [percent of load]


Note that I am finding the difference in days. You can find it in hours, minutes, seconds, years, etc.

For a more detailed knowledge on the DATEDIFF function, please visit

http://msdn.microsoft.com/en-us/library/ms189794.aspx


Hope this will help you.

1 1766
nbiswas
149 New Member
Use the DATEDIFF function whose general syntax is

Expand|Select|Wrap|Line Numbers
  1. DATEDIFF ( datepart , startdate , enddate )
So for your case the query will be

Select Datediff(day,[Loading Time In],[order time in]) AS [percent of load]


Note that I am finding the difference in days. You can find it in hours, minutes, seconds, years, etc.

For a more detailed knowledge on the DATEDIFF function, please visit

http://msdn.microsoft.com/en-us/library/ms189794.aspx


Hope this will help you.
Mar 26 '10 #2

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

Similar topics

1
by: Graham Mattingley | last post by:
Hi Group, I have used xmlHTTP to grab a page from a server.. The page has the '£' symbol in it, when it get to my site it is displayed as a '?'.. I have tryed replace every way I know and it...
10
by: Terry Olson | last post by:
I want to search a textbox and replace any instances of the dollar sign character. But when I do that it thinks it won't work because it think's I'm looking to replace something at the end of the...
1
by: Tim | last post by:
Hi, I'm kinda new to Dot Net in general and I'm trying to see if I can get some Connection stuff in a mesage box.. Well, I tried this code and I get an error that says " Type SQL Connection is not...
6
by: **Developer** | last post by:
I can't find how to search an entire solution for a string, say "Sub (ByRef" Nor how to search the entire solution using Regular Expressions. These were my favorite things - please don't tell me...
4
by: jpierson | last post by:
Hi, I'm having a few problems with the replace function for replacing characters in a textbox. "C:\" is the string i am tryin to remove ,with it a command I am sending does not work. ...
2
by: dasilva109 | last post by:
Hi guys I am new to C++ and need urgent help with this part of my code for a uni coursework I have to submit by Thursday //ClientData.h #ifndef CLIENTDATA_H #define CLIENTDATA_H #include...
3
by: hsmsites | last post by:
Anyone know how I can remove this symbol from a string. I'm using vi and do not know how to refer to this symbol in my script. TIA
20
by: junky_fellow | last post by:
Hi, In my previous post I asked if sizeof may be implemented as a function. Somebody pointed a link that says that sizeof may calculated as follows with a warning that it is not guaranteed to...
5
by: Keflavich | last post by:
Hey, I have a bit of code that died on a domain error when doing an arcsin, and apparently it's because floating point subtraction is having problems. I know about the impossibility of storing...
2
by: radhakrishnanrs | last post by:
Hi all, Here, a xml file is not in proper format. I need to replace the "&" symbol to "&amp;" under the attributes. Find below the sample xml file for glance: <root> <child1> <child2...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
1
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...
1
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
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 ...

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.