473,320 Members | 1,936 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.

To repeat a record 'n' number of times

Narender Sagar
189 100+
Hi
I have a table in which besides having other fields, there is one filed as Item code (Text) and another field as NumberOfTimes (numeric)
Item Code| NumberOfTimes| LotSize
x | 2 | 100
y | 3 | 50
z | 1 | 10
So I want to repeat this record as :
Item Code | LotSize
x |100
x | 100
y | 50
y | 50
y | 50
z | 10
I was using following SQL statement, which was giving me perfect result, however, all of sudden, this query started giving me following error : Data Type mismatch in Criteria Expression I am just unable to figure out the reason, as I've not changed any field type!
SQL :
Expand|Select|Wrap|Line Numbers
  1. SELECT MfgPlan.*
  2. FROM MfgPlan INNER JOIN MaxBatchNumbers ON MaxBatchNumbers.BatchNumber<= MfgPlan.NoOfTimes
  3. ORDER BY MfgPlan.ItemCode;
  4.  
Please help..!
Sep 21 '16 #1

✓ answered by jforbes

My best guess is there is at least one Null in your Data. Probably in MfgPlan.NoOfTimes

There is a possibility that there is a text value in MfgPlan.NoOfTimes

2 1066
jforbes
1,107 Expert 1GB
My best guess is there is at least one Null in your Data. Probably in MfgPlan.NoOfTimes

There is a possibility that there is a text value in MfgPlan.NoOfTimes
Sep 21 '16 #2
Narender Sagar
189 100+
Oh! Yes. there was an error in one of the row!!
Thanks for your advise.
best regards
Sep 22 '16 #3

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

Similar topics

3
by: Michael Charney | last post by:
I have a form where records are entered. I have turned off the built in record control. I created buttons to advance and go back through the records as well as an add new record button, but I also...
3
by: John Ortt | last post by:
> I have a table of dates in ascending order but with varying intervals. I > would like to create a query to pull out the date (in field 1) and then pull > the date from the subsequent record...
2
by: chris vettese | last post by:
I've been searching for a few days and have't found the solution I'm looking for. I want to create the following in my form's header...Material: 1 of 15. The first number will change as the user...
0
by: Carl | last post by:
I have a main form with navigation buttons on it and a label showing for example Record 1 of 15 using recordsetclone on it and eveything works fine. When I move through the records the record...
0
by: Scott269 | last post by:
So I've got an old MS Works database I imported into Access. I needed a primary key so I created a record number field that was just the record number I manually inserted when I entered it in the...
1
by: Scott269 | last post by:
So I've got an old MS Works database I imported into Access. I needed a primary key so I created a record number field that was just the record number I manually inserted when I entered it in the...
12
by: Martin Heuckeroth | last post by:
Hi Any idea on how to get a row number from the original table? We do a query and get a result. The row number from the result is different from the rownumber of the table the result originated...
16
by: usenet | last post by:
I want to be able to use the record numbers of a sub-form, are they available anyhow in VB (Access 2003)? I want to use the sub-form record number as *part* of the primary key for the table...
1
by: chaticathe | last post by:
I am trying to determine the record number of a record in Oracle Forms so I can navigate to that record. I am using the code below but it only gives me the record number of the record I am currently...
2
Dpot
by: Dpot | last post by:
I have a database that I'm trying to play with the idea of having it located in a folder on a network drive and just putting a shortcut to it on other peoples desktops. This will make it easier for...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
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: 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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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.