cancel
Showing results for 
Search instead for 
Did you mean: 

Update sql statement

0 Kudos

I have a Crystal Report with a Command that pulls the data from MS SQL server. I need to update a field if the value is 0. Can I put my update sql statement in a formula field to update the database?

Database: MS SQL Server

Update statement:

UPDATE TEST.dbo.TRACK

SET @maxtrack = @maxtrack+1 , TrackingNumber = @maxtrack

where JobNumber = '40734C'

and TrackingNumber = '0'

Accepted Solutions (1)

Accepted Solutions (1)

ido_millet
Active Contributor
0 Kudos

To use a formula for SQL Update, there's a 3rd-party Crystal Reports UFL (User Function Library) that includes a function for this.

Ken Hamady maintains a list of 3rd-party UFLs here.

Answers (1)

Answers (1)

0 Kudos

No but you may be able to use a SQLExpression, just be careful where you put it so it only gets triggered once.