This is what I ended up doing and it works also:
SELECT CASE WHEN right(sug_retail,2) >50 and right(sug_retail,2)<95 then replace(sug_retail,right(sug_retail,2),95) else replace(sug_retail,right(sug_retail,2),50) end as NewPrice
or for the full version:
case when...
Does anyone know of a way to round currency to the nearest .50 or .95? I need to calculate the retail cost of an item by taking the price + $3.00 * 1.43 and round it to the nearest .50 or .95. We always want to round up for example 47.44 would be $7.50 and $7.51 would be $7.95.
How would apply that is this scenario:
I want to insert approx. 3900 records into table A but I have to look at table B in order to make sure I am pulling the correct records. For example:
insert into cpnpmi_t (pmo_cde,itm_num,bil_cur,pmo_chc,pmo_cde1,seq_nbr8,itm_num1,
sub_chc)
SELECT...
I am trying to find a way to increment a field by 10 for each new record that is inserted into my table. The current value of the field is 00000000. I would like each record after the original to increment by 10 when added such as 00000010,00000020,00000030.... Can anyone show me how to do...
This will be a bit lengthy but here is some of the source
BuildFileForm.cs
using System;
using System.Drawing;
using System.Windows.Forms;
using System.IO;
using System.ComponentModel;
namespace FFB
{
/// <summary>
/// Description of BuildFileForm.
/// </summary>
public class...
All of the fields that have <tag/>, meaning the field is empty, pop up with an error that say field name can't be found. If I change the XML to <tag></tag> the file runs through just fine.
I am using a SharpDevelop program that takes an XML file and converts it to the format I need for data upload. The
client is send the XML file with <test/> as the closing tag when a data field is empty instead of <test></test>.
Does anyone know of a way I can change those tags to a well
fromed...
I am using a SharpDevelop program that takes an XML file and converts it to the format I need for data upload. The
client is send the XML file with <test/> as the closing tag when a data field is empty instead of <test></test>.
Does anyone know of a way I can change those tags to a well
fromed...
Here's some sample data. The first column is order number and last column is donor number. For the first record I would like the itm_nbr to be 0001. The itm_nbr for the second record should be 0001 and 0002 for the third record since record 2 and 3 have the same donor number and order number...
The donors each have a unique id assigned to them, such as
010000068070. If the same donor number appears twice you know that the donor has multiple gifts(donee's). The layout of my table is as follows: I need to populate the itm_nbr field with the record count as descibed.
select
ord_nbr...
this is what I have so far
DECLARE @count int
DECLARE @pos int
DECLARE @total_subs int
DECLARE @N INT
SET @pos = 1
SET @total_subs = 228
SET @n = 1
SET @count = 0
-- Declare temp variables to store row data
DECLARE @v1 char(12)
-- Declare cursor selecting correspoding data with temp...
I need to update a table with item numbers for each record. For example if the donor only exists on the file one time, his item number would be 0001. however if the donor exists on file multiple times I need to set the first item number to 0001, the second to 0002, and so on. Any help would be...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.