473,320 Members | 1,955 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,320 software developers and data experts.

Set a data item value depending on a generated record number

code green
1,726 Expert 1GB
Anybody know how to SELECT a running total of the records being returned from a query when the line number is not provided.
I am downloading product lines belonging to an order from a table using
Expand|Select|Wrap|Line Numbers
  1. SELECT '1' AS LineNumber, `products_model` AS Product, 
  2. `products_quantity` AS Quantity, `products_price` AS Price, 
  3. '' AS DiscValue, '0' AS LineTotalGross, `comments` 
  4. FROM `orders_products` 
  5. WHERE `orders_id` = '10560'
I am setting the line number to '1' as default then generating the line number in php.
But I only want 'comments' to appear in the line 1 details of every order and line 2, 3 etc comments to be empty.
So I thought of using
Expand|Select|Wrap|Line Numbers
  1. CASE WHEN LineNumber > 0 `comments` = ''
But not sure if this is legal and don't know how to get the record number.
Thanks in advance
Oct 17 '08 #1
0 1335

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

Similar topics

0
by: Redd | last post by:
The following is a technical report on a data modeling project that was recently assigned to me by my professor. I post it so that anyone else who is studying databases and data modeling can have...
19
by: Simon Verona | last post by:
I'm not sure if I'm going down the correct route... I have a class which exposes a number of properties of an object (in this case the object represents a customer). Can I then use this...
9
by: Brad | last post by:
I have written some code to manipulate data/records in a MASTER (order header) and DETAIL (order details) tables. What I have written is too extensive to post but essentially trying to: 1....
6
by: Rudy | last post by:
Hi all, I know this is easy, just can't seem to get it. I have a windows form, and a text box, with a value already in it. I need to add that value to a table. It's just one value, so the entire...
4
by: Robert | last post by:
Have main form with an unbound subform1 which is used for data entry. Subform1 has a nested continuous unbound subform (subform2) which is used to enter multiple records related to the record being...
9
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to...
2
by: =?Utf-8?B?dmFuZGls?= | last post by:
I have a web app that I have been working on for the last couple of weeks trying to solve this problem. One page contains a GridView with four base columns, and an unknown number of columns to be...
0
JamieHowarth0
by: JamieHowarth0 | last post by:
Hi folks, I'm making a snazzy VB.NET GUI as part of my contract for an asset management firm and it incorporates a TreeView control which I am using to graphically display details of locations,...
1
by: thithi | last post by:
Please help me " System.Data.SqlClient.SqlException: Prepared statement '(@Name varchar(100),@Describes varchar(100),@Money char(10))Upda' expects parameter @Describes, which was not supplied. at...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.