Sql Server - Apply The Formula On A Summary Field?

Feb 27, 2012

I am developing an inventory system and I have developed the following function to convert between cartons and pieces.

Public Function convertQTY(ByVal units_case As Integer, ByVal quantity As QTY) As QTY
While quantity.pieces < 0 And quantity.cartons > 0
If quantity.pieces < 0 And quantity.cartons > 0 Then

[Code]....

For example if units/pieces per carton is 144 then the above code converts the pieces into cartons if the number exceeds 144 and if the pieces are less than 0 then the above code subtracts 1 from carton and adds units per carton into the number of pieces. So that the pieces never exceed total number of pieces in a carton and they are never shown to be less than 0.

I want the same effect in summary field in my crystal report. For showing sum of cartons and pieces at the end of each group.

View 1 Replies


ADVERTISEMENT

Apply Rsi Indicators Formula To Access Database And To (test.txt)?

Nov 22, 2011

i store th date in access data base?i would like to do some calculation in two mothodes

1- i will create ListBox to Access Database so i will modfiy this code

'Add ListBox to a Form in VB.NET
standard Edition
'connect ListBox to Access Database
'read a list of keywords from a Database table 'Keywords'

[code]....

The very first calculations for average gain and average loss are simple 14 period averages.First Average Gain = Sum of Gains over the past 14 periods / 14.

View 4 Replies

Add Summary Field With Sum In A Datagridview?

Apr 21, 2010

How to Sum a field annew Summarry Row in datagridview

View 3 Replies

DB/Reporting :: Crystal Report That Fails On A Formula Field?

Apr 14, 2008

I have a crystal report that fails on a formula field but I cannot see why.

Here is my code:

Code:
Public Function CreateReportPDF(ByVal dsReport As DataSet, ByVal CrystalReportPath As String, _
ByVal reportSize As String, ByVal landScape As Boolean, _
ByVal dsParameters As DataSet, ByVal filePath As String, _
ByVal fileName As String) As Boolean

[Code]...

View 1 Replies

Group The Formula Field Results In Crystal Reports

Feb 1, 2012

I want Number of cartons and Pieces currently available in the stock that are about to expire in next 30 days and this is calculated based on expiry date...I have used formula field on crystal report to calculate current stock like "stock.crtns_added - stock.crtns_removed" and "stock.pieces_added - stock.pieces_removed"....Now I want to group by item name, category and expirydate because based on these three columns there can be more than 1 entries in the database....I want that when there are more than one entries the formula should sum up all the cartons and pieces for same item of a category with same expiry date and on report it should display just 1 line showing available cartons and pieces that are about to expire

How can i do this?? How can I apply group clause on the formula field in crystal report to get sum of cartons or pieces for each item based on expiry date??

View 1 Replies

[VS2005] Passing Value To Formula Field To Crystal Report

Apr 6, 2009

how to pass the value to the formula field in cyrstal report

View 1 Replies

VS 2005 Formula Editor - Can't Multiply Datatype Field With Other Integer Fields

Sep 10, 2009

I have a table with a Real datatype field. I just can't multiply it with other integer fields although the editor doesn't show any error - the result is always '1'.

View 4 Replies

Apply Inputmask In Sql Server 2005

Nov 18, 2009

can we apply the inputmask in sql server 2005 in vb.net?

View 1 Replies

Create A SQL Server User And Then Apply Permissions?

Dec 12, 2009

I am creating a multi-user application using VB 2005 Pro and SQL Server 2005.I would like to know what your ideas are when it comes to managing user permissions in regard to being able to view, add, edit and delete information in the database? Do you think I should have the end user type in the information into the VB application which then will create an SQL server user and then apply permissions to that security user or should I fine-grain the application by allowing groups to be created and then assigning permissions and users to those groups?

View 3 Replies

Implementing Radio Buttons - Select One Of Them To Use One Formula, And Then Select The Other To Use Another Formula

Feb 20, 2009

I want to place two radio buttons in so I can select one of them to use one formula, and then select the other to use another formula. I want to use the I=P(1+r)^n formula and I=P(1-r)^n formula with the radio button text showing Appreciation and Depreciation.

Heres my copy of the original code.

Public Class Form1

Private Sub cmdExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExit.Click
End
End Sub

[CODE].......................

View 5 Replies

Working With CSV Field In SQL Server

Jan 19, 2011

I am working on an application that pulls a field from a SQL Server table that has numeric values separated by commas, for example (1, 3, 4, 6). I need to load this field and somehow load it into a numeric array. However, I can't seem to come up with a good solution. Here is what I have tried:

Dim PagetoSign as Integer()
PageArray = Split(_DataRowView("PagestoSign"), ",")
Dim _PagetoSign As String = ""

[Code]....

However, I receive an error message when it enters the for each loop. I'm not married to this method if there is a more elegant way.

View 5 Replies

Sql Server - Getting Unique Field After Adding Row?

Jun 15, 2011

Possible Duplicate: Retrieve identity value from inserted record's primary key.I have a field with a unique field (that I don't have to update automatically) called ID. I'm using this code to add a field to it:

DB.Snippets.AddSnippetsRow(10, 0, Leaves, Coins, Date.Now, Language, Username, Description)

What I need to be able to do is get the unique field it adds. It +1's to ID every time I add a field there, but how do I get that without hacky database looping?

View 2 Replies

Update A Binary Field In SQL Server?

May 11, 2009

I know how to insert a new row into a table that has a binary column. But is there any way to update the binary column once that row has been added? So far an exhaustive google search has turned up nothing. Get the current row that I wish to update delete the row that I wish to update Create a new row with the information from the row I wish to update plus the new binary It just doesnt seem very elegant, and I was hoping I could do the same thing with an update statement. Here is the updated code I am using now for reference

[Code]...

View 2 Replies

Asp.net - Populate Label From Single Field In Sql Server

Sep 15, 2010

I have a column in a table that contains a message and I want this message to be displayed in a label. Here is my code which currently doesn't populate the label.

Protected conString As String = ConfigurationManager.AppSettings("sqldirectory")
Dim cnn As New SqlConnection(conString)
Dim cmd As New SqlCommand("select message from [database].[dbo].[table]")

[Code]....

View 1 Replies

Getting Null Value Of Hidden Field At Server-side

Feb 18, 2011

I am calling a Java-script function, in that i am passing the value of hidden field, that hidden field i want to use at server-side, but the value of hidden field is null.[code]...

View 1 Replies

How To Get Text From Sql Server Image Field Into StringCollection

May 5, 2009

I am Delphi programmer and I am new in .Net VB code to get text from sql server image field to StringCollection, in Delphi I use code:

MemoryStream := TMemoryStream.Create;
BlobStream := SomeQuery.CreateBlobStream(SomeQuery.FieldByName('MY IMAGE FIELD NAME'),bmReadWrite) as TBlobStream;
BlobStream.Position:=0;
MemoryStream.LoadFromStream(BlobStream);

[Code]...

View 1 Replies

Insert A Datetime Field Into The SQL Server Database?

Aug 12, 2011

I am not sure if this should be in the SQL or vb.net section.But, Basically I have a vb.net application from where I insert a datetime field into the SQL Server Database. Now for some reason the SQL server field(which is datetime) will not display AM/PM, I have referred this link where my code looks like this:

Dim dateToDisplay As DateTime = DateTime.Now dsNewRow.Item("date_created") = dateToDisplay.ToString("MM.dd.yyyy hh:mm:ss tt")

I tried stepping into the code by debugging and it seems to be inserting the PM but is not displayed in the table QuotedateToDisplay#8/12/2011 6:01:06 PM#Date

View 4 Replies

MS SQL Server, Indicating VARBINARY(MAX) Field's Datatype In .NET?

Oct 13, 2010

I use a VARBINARY(MAX) column, because I have no idea what is going to be put into it. All I know is that as of this point in time, the data will be one of many traditional data types(Integer, String, DateTime, etc.)I also have another column that is meant to indicate the DataType so the .NET application can handle the data and validate input accordingly.Right now, for testing, I have a DataType table in my database that stores the "supported" datatypes for the VARBINARY column, and a foreign key linking to the column meant to indicate the DataType. This works perfectly, but it feels akward.

View 2 Replies

SQL Server Open File From Image Field?

Apr 25, 2012

I have a field in a SQL Server 2005 DB of type 'image' that contains documents, mostly pdfs. When I view the field in the database, it looks as though the data is stored as a hex string. I have extensively googled and came up with the VB.net function below to convert the field to an actual file, but it only outputs a file containing the string of hex characters rather than the file that the field is supposed to represent.

This is a sample of the fields' data (I have truncated it for privacy purposes):

[Code]....

And is it possible to open the file straight from a query in SQL server?

View 1 Replies

VS 2008 - How To Insert Null Value Into SQL Server DateTime Field

May 7, 2009

How can I achieve this. Insert Null Value into SQL Server DateTime Field?

View 5 Replies

VS 2008 Update A SQL Server Database Date Field?

Aug 14, 2010

I am trying to update a SQL Server database Date field.When the user enters the date they enter 02 Oct 2010.When I pick up the DateTimePicker.Value it is 10/02/2010 00:00:00. I need to get the value to read 02/10/2010 00:00:00 How do I get the value to be in this format?

View 7 Replies

Zipping File Stored On SQL Server As Blob Image Field

Jul 14, 2010

I'm trying to zip a file that is stored on SQL Server as a blob image field and when downloading the zip file it says the file is corrupted.. or the file will open but contains some crazy characters. I've tried WinRAR and 7zip and no luck. I checked out [URL] and tried to kind of combine the browser attachment code and the memorystream/byte array code and no luck.

Here is my code snippet:
Try
BinData = DirectCast(dt.Rows(0)("ImageField"), Byte())
Catch ex As Exception
End Try
Dim blen As Integer = BinData.Length
[Code] .....

View 12 Replies

Clear This Summary Box?

Mar 3, 2011

I am a first year diploma in IT student and have this assignment here. Its for a catering business to calculate simply selections of food etc.So after calculation there is a summary to show total sales, number of sales and average sales. After the person clicks Ok i am asked to give them an option to clear summary.Now i need to know if they click yes how do i clear the summary?

Private Sub summaryButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles summaryButton.Click
'Calculate Average and Display Total Sales
Dim returnDialogResult As DialogResult

[code]....

View 6 Replies

How To Set Summary Properties

Nov 11, 2009

Before I publish my program, how do I set the summary properties? I mean the properties you see when you right click the exe file choose properties and then choose the "summary" tab.
There are the following properties:
Title
Subject
Keywords
Comments
Source
Author
Revision Number

View 1 Replies

Saving Data From A Text Field And Multiple Combo Boxes To A File On A Server In VB 2008?

Apr 28, 2010

saving data from a text field and multiple combo boxes to a file on a server in visual basic 2008

View 1 Replies

Sql Server - Linq - Limit List To 1 Row Per Unique Values Based On Value (minimum) Of Single Field

May 3, 2012

I have a stored procedure (I cannot edit) that I am calling via linq.

The stored procedure returns values (more complex but important data below):

Customer Stock Item Date Price Priority Qty
--------------------------------------------------------
CUST1 TAP 01-04-2012 £30 30 1 - 30
CUST1 TAP 05-04-2012 £33 30 1 - 30
CUST1 TAP 01-04-2012 £29 20 31 - 99
CUST1 TAP 01-04-2012 £28 10 1 - 30

I am trying to limit this list to rows which have unique Dates and unique quantities in LINQ. I want to remove items with the HIGHER priority leaving rows with unique dates and qty's.

I have tried several group by's using Max and order by's but have not been able to get a result.

Is there any way to do this via linq?

EDIT:

Managed to convert brad-rem's answer into VB.net.

Syntax below if anyone needs it:

returnlist = (From p In returnlist
Order By p.Qty Ascending, p.Priority
Group By AllGrp = p.Date, p.Qty Into g = Group
Select g.First).ToList

View 1 Replies

.net - Using Method Summary XML Comments?

Feb 9, 2011

I have been using the method summary XML Comments at the top of my procedures lately and am wondering if there are any logical or good practices related to this.I never put anything in the remarks because I put the description of the method in the summary tag. What belongs in the summary and what belongs in remarks?I seldom put anything in the returns tag because it seems like it would be redundant as I usually explain what is being returned in the summary. Should I simply keep the type of object returned in the returns tag?

View 4 Replies

Create A Summary Row Like On The Picture?

Sep 15, 2010

what is the best way to create a summary row like on the picture?[URL]..I'm trying it with an another dgv, but I can't create a dgv without column headers. Setting the visible property to false isn't good, because I must set the position of the summary balances.

View 8 Replies

Creating A Summary Form?

Dec 3, 2011

Ok, I have two forms. One which shows Personal Details of a client , the other which shows Calulations of their next Insurance bill.How do I create a so called 'Summary Form' which shows their details and insurance amount when I open the Summary Form ?

View 3 Replies

Getting Summary Button Function?

Mar 7, 2012

In my program the whole thing works minus one integral part the summary option needs to be gray or disabled until values are entered into the NAME, AND PIECES part is entered. Any suggestions? willing to submit my code in Private message to get a second more experienced look at it.

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved